-
Notifications
You must be signed in to change notification settings - Fork 7
145 lines (128 loc) · 4.82 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
on: [push, pull_request]
name: Build
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: |
sudo docker run -v ${{ github.workspace }}:${{ github.workspace }} -v $HOME/.cargo:/root/.cargo debian:10 bash -c "
set -e
apt-get update -y
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
apt install -y sudo dialog apt-utils git curl zip clang make ocl-icd-opencl-dev
export RUNLEVEL=1
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
source \$HOME/.cargo/env
git clone --depth 1 https://github.com/Microsoft/vcpkg.git ${{ github.workspace }}/vcpkg || true
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
${{ github.workspace }}/vcpkg/vcpkg install "opencl:x64-linux-release"
cd ${{ github.workspace }}
cargo build --release
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_CERTIFICATES }}
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 }}