37
37
name : artifacts
38
38
path : artifacts
39
39
40
- build-release :
40
+ build-release-artifacts :
41
41
name : build-release
42
42
needs : [create-github-release]
43
43
runs-on : ${{ matrix.job.os }}
@@ -48,15 +48,16 @@ jobs:
48
48
matrix :
49
49
rust : [stable]
50
50
job :
51
- - { os: "macOS-latest", target: "x86_64-apple-darwin", artifact_prefix: "macos" }
52
- - { os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact_prefix: "windows" }
53
- - { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact_prefix: "linux", }
51
+ - { name: "macOS-arm64", os: "macOS-latest", target: "aarch64-apple-darwin", artifact_prefix: "macos-arm64", use-cross: true }
52
+ - { name: "macOS-amd64", os: "macOS-latest", target: "x86_64-apple-darwin", artifact_prefix: "macos" }
53
+ - { name: "windows-amd64", os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact_prefix: "windows" }
54
+ - { name: "linux-gnu", os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact_prefix: "linux", }
54
55
# seems impossible to build static musl binaries due to XCB dependency. See https://github.com/rust-lang/rust/issues/116348
55
- # - { os: "ubuntu-latest", target: "x86_64-unknown-linux-musl", artifact_prefix: "linux-musl", }
56
- - { os: "ubuntu-latest", target: "aarch64-unknown-linux-gnu", artifact_prefix: "aarch64-gnu", use-cross: true, test-bin: "--bin jwtui" }
57
- - { os: "ubuntu-latest", target: "aarch64-unknown-linux-musl", artifact_prefix: "aarch64-musl", use-cross: true, test-bin: "--bin jwtui" }
58
- - { os: "ubuntu-latest", target: "arm-unknown-linux-gnueabihf", artifact_prefix: "arm-gnu", use-cross: true, test-bin: "--bin jwtui" }
59
- - { os: "ubuntu-latest", target: "arm-unknown-linux-musleabihf", artifact_prefix: "arm-musl", use-cross: true, test-bin: "--bin jwtui" }
56
+ # { name: "linux-musl", os: "ubuntu-latest", target: "x86_64-unknown-linux-musl", artifact_prefix: "linux-musl", }
57
+ - { name: "aarch64-gnu", os: "ubuntu-latest", target: "aarch64-unknown-linux-gnu", artifact_prefix: "aarch64-gnu", use-cross: true, test-bin: "--bin jwtui" }
58
+ - { name: "aarch64-musl", os: "ubuntu-latest", target: "aarch64-unknown-linux-musl", artifact_prefix: "aarch64-musl", use-cross: true, test-bin: "--bin jwtui" }
59
+ - { name: "arm-gnu", os: "ubuntu-latest", target: "arm-unknown-linux-gnueabihf", artifact_prefix: "arm-gnu", use-cross: true, test-bin: "--bin jwtui" }
60
+ - { name: "arm-musl", os: "ubuntu-latest", target: "arm-unknown-linux-musleabihf", artifact_prefix: "arm-musl", use-cross: true, test-bin: "--bin jwtui" }
60
61
61
62
steps :
62
63
- name : Checkout repository
@@ -111,7 +112,13 @@ jobs:
111
112
args : --release --verbose --target=${{ matrix.job.target }}
112
113
toolchain : ${{ matrix.rust }}
113
114
115
+ - name : Verify file
116
+ shell : bash
117
+ run : |
118
+ file target/${{ matrix.job.target }}/release/jwtui
119
+
114
120
- name : Test
121
+ if : matrix.job.target != 'aarch64-apple-darwin'
115
122
uses : actions-rs/cargo@v1
116
123
with :
117
124
use-cross : ${{ matrix.job.use-cross }}
@@ -171,8 +178,8 @@ jobs:
171
178
name : artifacts
172
179
path : artifacts
173
180
174
- publish-package -formula :
175
- needs : [build-release]
181
+ publish-homebrew -formula :
182
+ needs : [build-release-artifacts ]
176
183
name : Update homebrew & scoop formulas
177
184
runs-on : ubuntu-latest
178
185
steps :
@@ -192,24 +199,24 @@ jobs:
192
199
run : |
193
200
macos_sha="$(cat ./artifacts/jwtui-macos.sha256 | awk '{print $1}')"
194
201
echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV
202
+ macos_sha_arm="$(cat ./artifacts/jwtui-macos-arm64.sha256 | awk '{print $1}')"
203
+ echo "MACOS_SHA_ARM=$macos_sha_arm" >> $GITHUB_ENV
195
204
linux_sha="$(cat ./artifacts/jwtui-linux.sha256 | awk '{print $1}')"
196
205
echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV
197
- windows_sha="$(cat ./artifacts/jwtui-windows.sha256 | awk '{print $1}')"
198
- echo "WINDOWS_SHA=$windows_sha" >> $GITHUB_ENV
199
206
release_version="$(cat ./artifacts/release-version)"
200
207
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
201
208
202
209
- name : Validate release environment variables
203
210
run : |
204
211
echo "Release SHA macos: ${{ env.MACOS_SHA }}"
212
+ echo "Release SHA macos-arm: ${{ env.MACOS_SHA_ARM }}"
205
213
echo "Release SHA linux: ${{ env.LINUX_SHA }}"
206
- echo "Release SHA windows: ${{ env.WINDOWS_SHA }}"
207
214
echo "Release version: ${{ env.RELEASE_VERSION }}"
208
215
209
216
- name : Execute Homebrew packaging script
210
217
run : |
211
218
# run packaging script
212
- python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/jwt-ui.rb.template" "./jwt-ui.rb" ${{ env.MACOS_SHA }} ${{ env.LINUX_SHA }}
219
+ python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/jwt-ui.rb.template" "./jwt-ui.rb" ${{ env.MACOS_SHA }} ${{ env.MACOS_SHA_ARM }} ${{ env. LINUX_SHA }}
213
220
214
221
# push to Git
215
222
git config --global user.email "[email protected] "
@@ -222,6 +229,35 @@ jobs:
222
229
git diff-index --quiet HEAD || git commit -am "Update formula for jwt-ui release ${{ env.RELEASE_VERSION }}"
223
230
git push origin main
224
231
232
+ publish-scoop-formula :
233
+ needs : [build-release-artifacts]
234
+ name : Update scoop formulas
235
+ runs-on : ubuntu-latest
236
+ steps :
237
+ - name : Checkout repository
238
+ uses : actions/checkout@v2
239
+ with :
240
+ fetch-depth : 1
241
+
242
+ - name : Get release artifacts
243
+ uses : actions/download-artifact@v2
244
+ with :
245
+ name : artifacts
246
+ path : artifacts
247
+
248
+ - name : Set release assets and version
249
+ shell : bash
250
+ run : |
251
+ windows_sha="$(cat ./artifacts/jwtui-windows.sha256 | awk '{print $1}')"
252
+ echo "WINDOWS_SHA=$windows_sha" >> $GITHUB_ENV
253
+ release_version="$(cat ./artifacts/release-version)"
254
+ echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
255
+
256
+ - name : Validate release environment variables
257
+ run : |
258
+ echo "Release SHA windows: ${{ env.WINDOWS_SHA }}"
259
+ echo "Release version: ${{ env.RELEASE_VERSION }}"
260
+
225
261
- name : Execute Scoop packaging script
226
262
run : |
227
263
# run packaging script
@@ -239,6 +275,7 @@ jobs:
239
275
git push origin main
240
276
241
277
publish-cargo :
278
+ needs : [build-release-artifacts]
242
279
name : Publishing to Cargo
243
280
runs-on : ubuntu-latest
244
281
steps :
@@ -257,7 +294,7 @@ jobs:
257
294
args : --token ${{ secrets.CARGO_API_KEY }} --allow-dirty
258
295
259
296
publish-docker-image :
260
- needs : [build-release]
297
+ needs : [build-release-artifacts ]
261
298
name : Publishing Docker image to Docker Hub
262
299
runs-on : ubuntu-latest
263
300
steps :
0 commit comments