@@ -264,56 +264,116 @@ jobs:
264264 - name : ' cargo check'
265265 run : cargo check --workspace --all-targets --features windows
266266
267- build-installer-macos :
267+ build-installer :
268268 needs : changes
269269 if : ${{ needs.changes.outputs.but_installer == 'true' }}
270270 permissions :
271271 contents : read
272- runs-on : macos-14
272+ strategy :
273+ fail-fast : false
274+ matrix :
275+ include :
276+ - platform : macos-15 # [macOs, ARM64] - default target
277+ artifact_id : macos-15-aarch64
278+ target : ' '
279+ - platform : macos-15 # [macOs, x64] - cross-compile
280+ artifact_id : macos-15-x86_64
281+ target : x86_64-apple-darwin
282+ - platform : ubuntu-22.04 # [linux, x64]
283+ artifact_id : linux-x86_64
284+ target : ' '
285+ - platform : ubuntu-22.04-arm # [linux, ARM64]
286+ artifact_id : linux-aarch64
287+ target : ' '
288+
289+ runs-on : ${{ matrix.platform }}
290+
273291 env :
274292 CARGO_TERM_COLOR : always
275293 steps :
276294 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
277295 with :
278296 persist-credentials : false
279- - name : Install Rust targets
297+ - name : Set Cargo build target to ${{ matrix.target }}
298+ shell : bash
299+ if : matrix.target != ''
280300 run : |
281- rustup target add x86_64-apple-darwin
282- rustup target add aarch64-apple-darwin
301+ echo "CARGO_BUILD_TARGET=${{ matrix. target }}" >> $GITHUB_ENV
302+ rustup target add ${{ matrix.target }}
283303 - name : Rust Cache
284304 uses : Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
285305 with :
286- shared-key : installer-macos
306+ shared-key : installer
287307 save-if : ${{ github.ref == 'refs/heads/master' }}
288308 - name : Build installer for x86_64
289- run : cargo build --release -p but-installer --target x86_64-apple-darwin
290- - name : Build installer for aarch64
291- run : cargo build --release -p but-installer --target aarch64-apple-darwin
309+ run : cargo build --release -p but-installer
292310 - name : Verify binaries
293311 run : |
294- test -x target/x86_64-apple-darwin/release/but-installer
295- test -x target/aarch64-apple-darwin/release/but-installer
296- echo "x86_64 binary:"
297- file target/x86_64-apple-darwin/release/but-installer
298- echo "aarch64 binary:"
299- file target/aarch64-apple-darwin/release/but-installer
300- - name : Upload x86_64 installer artifact
312+ test -x target/${{matrix.target}}/release/but-installer
313+ file target/${{matrix.target}}/release/but-installer
314+ - name : Upload Artifacts
301315 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
302316 with :
303- name : ' but-installer-darwin-x86_64-${{ github.run_number }}'
304- path : target/x86_64-apple-darwin/release/but-installer
305- retention-days : 7
317+ name : ' but-installer-${{ matrix.artifact_id }}-${{ github.run_number }}'
318+ path : target/${{matrix.target}}/release/but-installer
306319 if-no-files-found : error
307- - name : Upload aarch64 installer artifact
308- uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
309- with :
310- name : ' but-installer-darwin-aarch64-${{ github.run_number }}'
311- path : target/aarch64-apple-darwin/release/but-installer
312320 retention-days : 7
313- if-no-files-found : error
321+
322+ fetch-published-versions :
323+ needs : build-installer
324+ runs-on : ubuntu-22.04
325+ permissions :
326+ contents : none
327+ outputs :
328+ release_version : ${{ steps.fetch.outputs.release_version }}
329+ nightly_version : ${{ steps.fetch.outputs.nightly_version }}
330+ steps :
331+ - name : Fetch latest release and nightly versions
332+ id : fetch
333+ run : |
334+ echo "release_version=$(curl -s https://app.gitbutler.com/releases | jq -r .version)" >> $GITHUB_OUTPUT
335+ echo "nightly_version=$(curl -s https://app.gitbutler.com/releases/nightly | jq -r .version)" >> $GITHUB_OUTPUT
336+
337+ validate-installer :
338+ needs :
339+ - build-installer
340+ - fetch-published-versions
341+ permissions :
342+ contents : none
343+ env :
344+ LATEST_RELEASE_VERSION : ${{ needs.fetch-published-versions.outputs.release_version }}
345+ LATEST_NIGHTLY_VERSION : ${{ needs.fetch-published-versions.outputs.nightly_version }}
346+ strategy :
347+ fail-fast : false
348+ matrix :
349+ include :
350+ - platform : macos-15 # [macOs, ARM64] - default target
351+ artifact_id : macos-15-aarch64
352+ - platform : macos-15 # [macOs, x64] - cross-compile
353+ artifact_id : macos-15-x86_64
354+ - platform : ubuntu-22.04 # [linux, x64]
355+ artifact_id : linux-x86_64
356+ - platform : ubuntu-22.04-arm # [linux, ARM64]
357+ artifact_id : linux-aarch64
358+ runs-on : ${{ matrix.platform }}
359+ steps :
360+ - name : Download ${{ matrix.artifact_id }} installer
361+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
362+ with :
363+ name : ' but-installer-${{ matrix.artifact_id }}-${{ github.run_number }}'
364+ path : .
365+ - run : chmod +x ./but-installer
366+ - name : Install release
367+ run : ./but-installer
368+ - name : Validate release version
369+ run : but --version | grep "but $LATEST_RELEASE_VERSION"
370+ - name : Install nightly
371+ run : ./but-installer nightly
372+ - name : Validate nightly version
373+ run : but --version | grep "but $LATEST_NIGHTLY_VERSION"
314374
315375 publish-installer :
316- needs : build-installer-macos
376+ needs : build-installer
317377 if : ${{ github.ref == 'refs/heads/master' }}
318378 runs-on : ubuntu-latest
319379 permissions :
@@ -322,23 +382,29 @@ jobs:
322382 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
323383 with :
324384 persist-credentials : false
325- - name : Download x86_64 installer
385+ - name : Download macOS x86_64 installer
386+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
387+ with :
388+ name : ' but-installer-macos-15-x86_64-${{ github.run_number }}'
389+ path : s3-upload/macos/x86_64
390+ - name : Download macOS aarch64 installer
391+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
392+ with :
393+ name : ' but-installer-macos-15-aarch64-${{ github.run_number }}'
394+ path : s3-upload/macos/aarch64
395+ - name : Download Linux x86_64 installer
326396 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
327397 with :
328- name : ' but-installer-darwin -x86_64-${{ github.run_number }}'
329- path : installer-artifacts/darwin- x86_64
330- - name : Download aarch64 installer
398+ name : ' but-installer-linux -x86_64-${{ github.run_number }}'
399+ path : s3-upload/linux/ x86_64
400+ - name : Download Linux aarch64 installer
331401 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
332402 with :
333- name : ' but-installer-darwin -aarch64-${{ github.run_number }}'
334- path : installer-artifacts/darwin- aarch64
335- - name : Prepare S3 payload
403+ name : ' but-installer-linux -aarch64-${{ github.run_number }}'
404+ path : s3-upload/linux/ aarch64
405+ - name : Make binaries executable
336406 run : |
337- mkdir -p s3-upload/macos/x86_64
338- mkdir -p s3-upload/macos/aarch64
339- cp installer-artifacts/darwin-x86_64/but-installer s3-upload/macos/x86_64/but-installer
340- cp installer-artifacts/darwin-aarch64/but-installer s3-upload/macos/aarch64/but-installer
341- chmod +x s3-upload/macos/*/but-installer
407+ find ./s3-upload -name 'but-installer' | xargs chmod +x
342408 - name : Upload to S3
343409 uses : shallwefootball/s3-upload-action@4350529f410221787ccf424e50133cbc1b52704e # master
344410 with :
@@ -365,7 +431,7 @@ jobs:
365431 - rust-test-tauri
366432 - rust-lint
367433 - cargo-doc
368- - build-installer-macos
434+ - build-installer
369435 runs-on : ubuntu-latest
370436 env :
371437 CARGO_TERM_COLOR : always
@@ -431,7 +497,7 @@ jobs:
431497 - name : run playwright tests
432498 run : pnpm exec turbo run test:ct
433499 if : ${{ github.ref != 'refs/heads/master' }}
434- - uses : actions/upload-artifact@v6
500+ - uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
435501 if : ${{ !cancelled() }}
436502 with :
437503 name : playwright-report
0 commit comments