@@ -2,24 +2,31 @@ name: Release
22on :
33 push :
44 tags :
5- - ' *'
5+ - " *"
6+ pull_request :
7+
68jobs :
79 build :
810 name : Build for ${{ matrix.name }}
911 runs-on : ${{ matrix.os }}
1012 strategy :
1113 fail-fast : false
14+ # The runner images are chosen to be one major version behind the latest.
15+ # The macOS runner should be x86_64 so that the binary can run on both Intel and Apple Silicon Macs.
16+ # For example, as of Sep 2025
17+ # - The latest Ubuntu is 24.04, so we use ubuntu-22.04
18+ # - The latest macOS is 15, so we use macos-14-large
1219 matrix :
1320 include :
14- - os : ubuntu-20 .04
21+ - os : ubuntu-22 .04
1522 name : linux64
1623 artifact_name : target/release/ic-wasm
1724 asset_name : ic-wasm-linux64
18- - os : ubuntu-20 .04
25+ - os : ubuntu-22 .04
1926 name : linux-musl
2027 artifact_name : target/release/ic-wasm
2128 asset_name : ic-wasm-linux-musl
22- - os : macos-13
29+ - os : macos-14-large # x86_64 build that can run on both Intel and Apple Silicon Macs
2330 name : macos
2431 artifact_name : target/release/ic-wasm
2532 asset_name : ic-wasm-macos
4350 cargo build --release --locked
4451 '
4552
46- - name : ' Upload assets'
53+ - name : " Upload assets"
4754 uses : actions/upload-artifact@v4
4855 with :
4956 name : ${{ matrix.asset_name }}
@@ -56,17 +63,24 @@ jobs:
5663 runs-on : ${{ matrix.os }}
5764 strategy :
5865 fail-fast : false
66+ # The binaries built in the `build` job are tested on:
67+ # - Ubuntu: latest and one major version behind latest.
68+ # - macOS: latest and one major version behind latest. Both x86_64 and arm64 runner images.
5969 matrix :
6070 include :
61- - os : ubuntu-22.04
62- asset_name : ic-wasm-linux64
63- - os : ubuntu-20.04
71+ - os : ubuntu-latest
6472 asset_name : ic-wasm-linux64
6573 - os : ubuntu-22.04
74+ asset_name : ic-wasm-linux64
75+ - os : ubuntu-latest
6676 asset_name : ic-wasm-linux-musl
67- - os : ubuntu-20 .04
77+ - os : ubuntu-22 .04
6878 asset_name : ic-wasm-linux-musl
69- - os : macos-13
79+ - os : macos-latest-large
80+ asset_name : ic-wasm-macos
81+ - os : macos-latest
82+ asset_name : ic-wasm-macos
83+ - os : macos-14-large
7084 asset_name : ic-wasm-macos
7185 - os : macos-14
7286 asset_name : ic-wasm-macos
92106 ./ic-wasm --version
93107
94108 publish :
109+ # Check if the workflow was triggered by a tag
110+ if : startsWith(github.ref, 'refs/tags/')
95111 needs : test
96112 name : Publish ${{ matrix.asset_name }}
97113 strategy :
@@ -130,4 +146,4 @@ jobs:
130146 repo_token : ${{ secrets.GITHUB_TOKEN }}
131147 file : ${{ matrix.binstall_name }}
132148 asset_name : ${{ matrix.binstall_name }}
133- tag : ${{ github.ref }}
149+ tag : ${{ github.ref }}
0 commit comments