ccpp_mac.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. name: C/C++ CI macos
  2. on:
  3. push:
  4. branches:
  5. - CI
  6. jobs:
  7. build:
  8. runs-on: macos-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. with:
  12. ref: 'CI'
  13. - name: change date in version
  14. run: |
  15. sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc
  16. mv version.date.inc version.inc
  17. - name: mkdir build
  18. run: mkdir deps/build
  19. - name: get deps
  20. working-directory: ./deps/build
  21. run: curl -L -o deps_mac.zip https://github.com/supermerill/SuperSlicer_deps/releases/latest/download/deps_mac.zip
  22. - name: unzip deps
  23. working-directory: ./deps/build
  24. run: unzip deps_mac.zip
  25. - name: mkdir build
  26. run: mkdir build
  27. - name: cmake
  28. working-directory: ./build
  29. run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  30. - name: make slic3r
  31. working-directory: ./build
  32. run: make slic3r
  33. - name: update Info.plist
  34. working-directory: ./build/src
  35. run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
  36. - name: create directory and copy into it
  37. working-directory: ./build
  38. run: |
  39. mkdir SuperSlicer
  40. mkdir SuperSlicer/SuperSlicer.app
  41. mkdir SuperSlicer/SuperSlicer.app/Contents
  42. mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
  43. mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
  44. mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
  45. - name: copy resources
  46. working-directory: ./build
  47. run: |
  48. cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
  49. cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
  50. cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
  51. echo -n -e 'APPL????\x0a' > PkgInfo
  52. cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
  53. # echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
  54. - name: copy bin and do not let it lower case
  55. working-directory: ./build
  56. run: |
  57. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  58. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  59. tar -cvf SuperSlicer.tar SuperSlicer
  60. - name: create dmg
  61. working-directory: ./build
  62. run: |
  63. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  64. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  65. # - name: signing resources (creating CodeResources inside _CodeSignature)
  66. # working-directory: .
  67. # run: codesign -s <identity> resources
  68. # maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
  69. - name: Upload artifact
  70. uses: actions/upload-artifact@v1.0.0
  71. with:
  72. name: nightly_macos.tar
  73. path: build/SuperSlicer.tar
  74. - name: Upload artifact
  75. uses: actions/upload-artifact@v1.0.0
  76. with:
  77. name: nightly_macos.dmg
  78. path: build/SuperSlicer.dmg
  79. # build again, but the debug one this time
  80. - name: cmake
  81. working-directory: ./build
  82. run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  83. - name: make slic3r
  84. working-directory: ./build
  85. run: make slic3r
  86. - name: copy bin and do not let it lower case
  87. working-directory: ./build
  88. run: |
  89. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  90. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  91. tar -cvf SuperSlicer.tar SuperSlicer
  92. - name: create dmg
  93. working-directory: ./build
  94. run: |
  95. rm SuperSlicer.dmg
  96. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  97. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  98. - name: Upload artifact
  99. uses: actions/upload-artifact@v1.0.0
  100. with:
  101. name: nightly_macos_DEBUG.dmg
  102. path: build/SuperSlicer.dmg