1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- name: C/C++ CI macos
- on:
- release:
- types: [published]
- jobs:
- build:
- runs-on: macos-latest
-
- steps:
- - uses: actions/checkout@v1
- - name: Get current date
- id: date
- run: echo "::set-output name=date::$(date +'%Y%m%d')"
- - name: change date in version
- run: |
- sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc
- mv version.date.inc version.inc
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
- working-directory: ./build
- run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
- - name: make slic3r
- working-directory: ./build
- run: make slic3r
- - name: update Info.plist
- working-directory: ./build/src
- run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir SuperSlicer
- mkdir SuperSlicer/SuperSlicer.app
- mkdir SuperSlicer/SuperSlicer.app/Contents
- mkdir SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
- mkdir SuperSlicer/SuperSlicer.app/Contents/Frameworks
- mkdir SuperSlicer/SuperSlicer.app/Contents/MacOS
- - name: copy resources
- working-directory: ./build
- run: |
- cp -Rf ../resources SuperSlicer/SuperSlicer.app/Contents/resources
- cp SuperSlicer/SuperSlicer.app/Contents/resources/icons/slic3r.icns SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
- cp src/Info.date.plist SuperSlicer/SuperSlicer.app/Contents/Info.plist
- echo -n -e 'APPL????\x0a' > PkgInfo
- cp PkgInfo SuperSlicer/SuperSlicer.app/Contents/PkgInfo
- # echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
- - name: copy bin
- working-directory: ./build
- run: |
- cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
- chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
- tar -zcvf SuperSlicer.tar.gz SuperSlicer
- - name: create dmg
- working-directory: ./build
- run: |
- hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "SuperSlicer" temp.dmg
- hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
- # - name: signing resources (creating CodeResources inside _CodeSignature)
- # working-directory: .
- # run: codesign -s <identity> resources
- # maybe i should just try to do that on a separate pc and copy the file here, more secure as a signing process.
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ github.event.release.upload_url }}
- asset_path: ./build/SuperSlicer.tar.gz
- asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.tar.gz
- asset_content_type: application/gzip
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: ./build/nightly_macos.dmg
- asset_name: SuperSlicer_${{ github.event.release.tag_name }}_macos_${{steps.date.outputs.date}}.dmg
- asset_content_type: application/x-apple-diskimage
|