ccpp_mac_release.yml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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: get deps
  18. run: curl -L -o deps_linux.zip https://github.com/supermerill/SuperSlicer_deps/releases/latest/download/deps_mac.zip
  19. - name: unzip deps
  20. run: unzip deps_mac
  21. - name: mkdir build
  22. run: mkdir build
  23. - name: cmake
  24. working-directory: ./build
  25. run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
  26. - name: make slic3r
  27. working-directory: ./build
  28. run: make slic3r
  29. - name: update Info.plist
  30. working-directory: ./build/src
  31. run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
  32. - name: create directory and copy into it
  33. working-directory: ./build
  34. run: |
  35. mkdir SuperSlicer
  36. mkdir SuperSlicer/SuperSlicer.app
  37. mkdir SuperSlicer/SuperSlicer.app/Contents
  38. mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
  39. mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
  40. mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
  41. - name: copy resources
  42. working-directory: ./build
  43. run: |
  44. cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
  45. cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
  46. cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
  47. echo -n -e 'APPL????\x0a' > PkgInfo
  48. cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
  49. # echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
  50. - name: copy bin
  51. working-directory: ./build
  52. run: |
  53. cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  54. chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
  55. tar -zcvf SuperSlicer.tar.gz SuperSlicer
  56. - name: create dmg
  57. working-directory: ./build
  58. run: |
  59. hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
  60. hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
  61. # - name: signing resources (creating CodeResources inside _CodeSignature)
  62. # working-directory: .
  63. # run: codesign -s <identity> resources
  64. # maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
  65. - name: Upload Release Asset
  66. id: upload-release-asset
  67. uses: actions/upload-release-asset@v1
  68. env:
  69. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  70. with:
  71. upload_url: ${{ github.event.release.upload_url }}
  72. asset_path: ./build/SuperSlicer.tar.gz
  73. asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.tar.gz
  74. asset_content_type: application/gzip
  75. - name: Upload Release Asset
  76. id: upload-release-asset
  77. uses: actions/upload-release-asset@v1
  78. env:
  79. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  80. with:
  81. upload_url: ${{ steps.create_release.outputs.upload_url }}
  82. asset_path: ./build/nightly_macos.dmg
  83. asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.dmg
  84. asset_content_type: application/x-apple-diskimage