Fix macos build #166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Build | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- run: sudo apt-get update -y | |
- run: sudo apt-get install -y ocl-icd-opencl-dev libgtk-3-dev | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
- uses: Swatinem/rust-cache@v2 | |
- uses: lukka/get-cmake@latest | |
- uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: ac12118f02e127ef1fe9806ffe1a23e7db7ef988 | |
- name: Install OpenCL | |
run: vcpkg install "opencl:x64-linux-release" | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- run: make target/gyroflow-ofx-linux.zip | |
- name: Save Binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gyroflow-ofx-linux | |
path: target/gyroflow-ofx-linux.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/gyroflow-ofx-linux.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
macos: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
- uses: Swatinem/rust-cache@v2 | |
- name: Add rust target | |
run: rustup target add aarch64-apple-darwin | |
- uses: lukka/get-cmake@latest | |
- uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: ac12118f02e127ef1fe9806ffe1a23e7db7ef988 | |
- name: Install OpenCL | |
run: | | |
vcpkg install "opencl:x64-osx-release" | |
vcpkg install "opencl:arm64-osx" | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target x86_64-apple-darwin | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target aarch64-apple-darwin | |
- name: Install Mac certificate | |
uses: apple-actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} | |
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
- run: make target/gyroflow-ofx-macosx.dmg | |
env: | |
SIGNING_FINGERPRINT: ${{ secrets.MACOS_CERTIFICATE_FINGERPRINT }} | |
- name: Notarize and staple release build | |
run: | | |
npx notarize-cli --file target/gyroflow-ofx-macosx.dmg --bundle-id xyz.gyroflow.ofx --asc-provider="${{ secrets.MACOS_TEAM }}" --username="${{ secrets.MACOS_ACCOUNT_USER }}" --password="${{ secrets.MACOS_ACCOUNT_PASS }}" | |
xcrun stapler staple --verbose target/gyroflow-ofx-macosx.dmg | |
- name: Save Binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gyroflow-ofx-macosx | |
path: target/gyroflow-ofx-macosx.dmg | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/gyroflow-ofx-macosx.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
target: x86_64-pc-windows-msvc | |
- uses: Swatinem/rust-cache@v2 | |
- uses: lukka/get-cmake@latest | |
- uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: ac12118f02e127ef1fe9806ffe1a23e7db7ef988 | |
- name: Install OpenCL | |
run: vcpkg install "opencl:x64-windows-release" | |
- run: choco install -y llvm zip | |
- run: echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | |
- uses: actions-rs/cargo@v1 | |
env: | |
RUSTFLAGS: -L C:/vcpkg/packages/opencl_x64-windows-release/lib/ | |
with: | |
command: build | |
args: --release | |
- run: make target/gyroflow-ofx-windows.zip | |
- name: Save Binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gyroflow-ofx-windows | |
path: target/gyroflow-ofx-windows.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/gyroflow-ofx-windows.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |