ccpp_mac_release.yml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: C/C++ CI macos
  2. on:
  3. release:
  4. types: [published]
  5. jobs:
  6. build:
  7. runs-on: macos-latest
  8. steps:
  9. - uses: actions/checkout@v1
  10. - name: Get current date
  11. id: date
  12. run: echo "::set-output name=date::$(date +'%Y%m%d')"
  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: clean deps
  26. working-directory: ./deps/build
  27. run: rm -rf dep_*
  28. - name: mkdir build
  29. run: mkdir build
  30. - name: cmake
  31. working-directory: ./build
  32. run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  33. - name: make slic3r
  34. working-directory: ./build
  35. run: make slic3r
  36. - name: update Info.plist
  37. working-directory: ./build/src
  38. run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
  39. - name: create directory and copy into it
  40. working-directory: ./build
  41. run: |
  42. mkdir SuperSlicer
  43. mkdir SuperSlicer/SuperSlicer.app
  44. mkdir SuperSlicer/SuperSlicer.app/Contents
  45. mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
  46. mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
  47. mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
  48. - name: copy resources
  49. working-directory: ./build
  50. run: |
  51. cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
  52. cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
  53. cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
  54. echo -n -e 'APPL????\x0a' > PkgInfo
  55. cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
  56. # echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
  57. - name: copy bin
  58. working-directory: ./build
  59. run: |
  60. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  61. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  62. tar -zcvf SuperSlicer.tar.gz SuperSlicer
  63. - name: create dmg
  64. working-directory: ./build
  65. run: |
  66. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  67. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  68. # - name: signing resources (creating CodeResources inside _CodeSignature)
  69. # working-directory: .
  70. # run: codesign -s <identity> resources
  71. # maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
  72. - name: Upload Release Asset
  73. id: upload-release-asset
  74. uses: actions/upload-release-asset@v1
  75. env:
  76. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  77. with:
  78. upload_url: ${{ github.event.release.upload_url }}
  79. asset_path: ./build/SuperSlicer.tar.gz
  80. asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.tar.gz
  81. asset_content_type: application/gzip
  82. - name: Upload Release Asset
  83. id: upload-release-asset
  84. uses: actions/upload-release-asset@v1
  85. env:
  86. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  87. with:
  88. upload_url: ${{ steps.create_release.outputs.upload_url }}
  89. asset_path: ./build/nightly_macos.dmg
  90. asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.dmg
  91. asset_content_type: application/x-apple-diskimage