ccpp_mac.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 in deps
  18. run: mkdir deps/build
  19. - name: cmake deps
  20. working-directory: ./deps/build
  21. run: cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
  22. - name: make deps
  23. working-directory: ./deps/build
  24. run: make
  25. - name: ls libs
  26. working-directory: ./deps/build
  27. run: ls ./destdir/usr/local/lib
  28. - name: rename wxscintilla
  29. working-directory: ./deps/build/destdir/usr/local/lib
  30. run: cp libwxscintilla-3.1.a libwx_osx_cocoau_scintilla-3.1.a
  31. - name: ls libs
  32. working-directory: ./deps/build
  33. run: ls ./destdir/usr/local/lib
  34. - name: clean deps
  35. working-directory: ./deps/build
  36. run: rm -rf dep_*
  37. - name: mkdir build
  38. run: mkdir build
  39. - name: cmake
  40. working-directory: ./build
  41. run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  42. - name: make slic3r
  43. working-directory: ./build
  44. run: make slic3r
  45. - name: update Info.plist
  46. working-directory: ./build/src
  47. run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
  48. - name: create directory and copy into it
  49. working-directory: ./build
  50. run: |
  51. mkdir SuperSlicer
  52. mkdir SuperSlicer/SuperSlicer.app
  53. mkdir SuperSlicer/SuperSlicer.app/Contents
  54. mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
  55. mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
  56. mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
  57. - name: copy resources
  58. working-directory: ./build
  59. run: |
  60. cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
  61. cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
  62. cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
  63. echo -n -e 'APPL????\x0a' > PkgInfo
  64. cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
  65. # echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
  66. - name: copy bin and do not let it lower case
  67. working-directory: ./build
  68. run: |
  69. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  70. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  71. tar -cvf SuperSlicer.tar SuperSlicer
  72. - name: create dmg
  73. working-directory: ./build
  74. run: |
  75. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  76. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  77. # - name: signing resources (creating CodeResources inside _CodeSignature)
  78. # working-directory: .
  79. # run: codesign -s <identity> resources
  80. # maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
  81. - name: Upload artifact
  82. uses: actions/upload-artifact@v1.0.0
  83. with:
  84. name: nightly_macos.tar
  85. path: build/SuperSlicer.tar
  86. - name: Upload artifact
  87. uses: actions/upload-artifact@v1.0.0
  88. with:
  89. name: nightly_macos.dmg
  90. path: build/SuperSlicer.dmg
  91. # build again, but the debug one this time
  92. - name: cmake
  93. working-directory: ./build
  94. run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  95. - name: make slic3r
  96. working-directory: ./build
  97. run: make slic3r
  98. - name: copy bin and do not let it lower case
  99. working-directory: ./build
  100. run: |
  101. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  102. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  103. tar -cvf SuperSlicer.tar SuperSlicer
  104. - name: create dmg
  105. working-directory: ./build
  106. run: |
  107. rm SuperSlicer.dmg
  108. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  109. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  110. - name: Upload artifact
  111. uses: actions/upload-artifact@v1.0.0
  112. with:
  113. name: nightly_macos_DEBUG.dmg
  114. path: build/SuperSlicer.dmg