@@ -22,7 +22,6 @@ defaults:
2222 shell : bash
2323
2424env :
25- ACTIONS_RUNNER_DEBUG : true
2625 NPM_CONFIG_PROVENANCE : true
2726 NPM_REGISTRY_URL : " https://registry.npmjs.org"
2827
@@ -32,22 +31,72 @@ jobs:
3231 contents : read
3332 actions : read
3433 id-token : write
35- name : ${{ matrix.os }}-${{ matrix.arch }}
34+ name : ${{ matrix.tool }}-${{ matrix. os }}-${{ matrix.arch }}
3635 runs-on : ubuntu-latest
3736 strategy :
3837 max-parallel : 3
3938 fail-fast : false
4039 matrix :
4140 include :
42- - os : linux
41+ - tool : forge
42+ os : linux
4343 arch : amd64
44- - os : linux
44+ - tool : forge
45+ os : linux
4546 arch : arm64
46- - os : darwin
47+ - tool : forge
48+ os : darwin
4749 arch : amd64
48- - os : darwin
50+ - tool : forge
51+ os : darwin
4952 arch : arm64
50- - os : win32
53+ - tool : forge
54+ os : win32
55+ arch : amd64
56+ - tool : cast
57+ os : linux
58+ arch : amd64
59+ - tool : cast
60+ os : linux
61+ arch : arm64
62+ - tool : cast
63+ os : darwin
64+ arch : amd64
65+ - tool : cast
66+ os : darwin
67+ arch : arm64
68+ - tool : cast
69+ os : win32
70+ arch : amd64
71+ - tool : anvil
72+ os : linux
73+ arch : amd64
74+ - tool : anvil
75+ os : linux
76+ arch : arm64
77+ - tool : anvil
78+ os : darwin
79+ arch : amd64
80+ - tool : anvil
81+ os : darwin
82+ arch : arm64
83+ - tool : anvil
84+ os : win32
85+ arch : amd64
86+ - tool : chisel
87+ os : linux
88+ arch : amd64
89+ - tool : chisel
90+ os : linux
91+ arch : arm64
92+ - tool : chisel
93+ os : darwin
94+ arch : amd64
95+ - tool : chisel
96+ os : darwin
97+ arch : arm64
98+ - tool : chisel
99+ os : win32
51100 arch : amd64
52101 # Run automatically after a successful 'release' workflow, or manually if a run_id is provided
53102 if : >-
@@ -98,14 +147,6 @@ jobs:
98147 node-version : " 24"
99148 registry-url : " https://registry.npmjs.org"
100149
101- - name : Install Dependencies
102- working-directory : ./npm
103- run : bun install --frozen-lockfile
104-
105- - name : Transpile TS -> JS
106- working-directory : ./npm
107- run : bun run build
108-
109150 - name : Derive RELEASE_VERSION
110151 id : release-version
111152 working-directory : ./npm
@@ -142,33 +183,26 @@ jobs:
142183 ARTIFACT_DIR : ${{ steps.paths.outputs.artifact_dir }}
143184 run : |
144185 set -euo pipefail
145- mkdir -p "$ARTIFACT_DIR/tmp"
146186
147- FILE_PREFIX="$ARTIFACT_DIR/foundry_${RELEASE_VERSION}_${{ matrix.os }}_${{ matrix.arch }}"
148- if [[ -f "${FILE_PREFIX}.zip" ]]; then
149- echo "Extracting ${FILE_PREFIX}.zip"
150- if ! command -v unzip >/dev/null 2>&1; then
151- sudo apt-get update -y && sudo apt-get install -y unzip
152- fi
153- unzip -o "${FILE_PREFIX}.zip" -d "$ARTIFACT_DIR/tmp"
154- BIN="$ARTIFACT_DIR/tmp/forge.exe"
155- else
156- echo "Extracting ${FILE_PREFIX}.tar.gz"
157- tar -xzf "${FILE_PREFIX}.tar.gz" -C "$ARTIFACT_DIR/tmp"
158- BIN="$ARTIFACT_DIR/tmp/forge"
159- fi
160-
161- echo "Staging binary $BIN into @foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
162- PLATFORM_NAME=${{ matrix.os }} ARCH=${{ matrix.arch }} FORGE_BIN_PATH="$BIN" bun ./scripts/prepublish.ts
187+ bun ./scripts/stage-from-artifact.mjs \
188+ --tool '${{ matrix.tool }}' \
189+ --platform '${{ matrix.os }}' \
190+ --arch '${{ matrix.arch }}' \
191+ --release-version "$RELEASE_VERSION" \
192+ --artifact-dir "$ARTIFACT_DIR"
163193
164194 - name : Sanity Check Binary
165195 working-directory : ./npm
166196 run : |
167197 set -euo pipefail
168- PKG_DIR="./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
169- BIN="$PKG_DIR/bin/forge"
170- if [[ "${{ matrix.os }}" == "win32" ]]; then
171- BIN="$PKG_DIR/bin/forge.exe"
198+ TOOL='${{ matrix.tool }}'
199+ PLATFORM='${{ matrix.os }}'
200+ ARCH='${{ matrix.arch }}'
201+
202+ PKG_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
203+ BIN="$PKG_DIR/bin/${TOOL}"
204+ if [[ "$PLATFORM" == "win32" ]]; then
205+ BIN="$PKG_DIR/bin/${TOOL}.exe"
172206 fi
173207 echo "Verifying binary at: $BIN"
174208 ls -la "$BIN"
@@ -195,11 +229,16 @@ jobs:
195229 run : |
196230 set -euo pipefail
197231
198- ls -la ./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}
232+ TOOL='${{ matrix.tool }}'
233+ PLATFORM='${{ matrix.os }}'
234+ ARCH='${{ matrix.arch }}'
199235
200- bun ./scripts/publish.ts ./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}
236+ PACKAGE_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
237+ ls -la "$PACKAGE_DIR"
201238
202- echo "Published @foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
239+ bun ./scripts/publish.mjs "$PACKAGE_DIR"
240+
241+ echo "Published @foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
203242
204243 publish-meta :
205244 permissions :
@@ -234,13 +273,15 @@ jobs:
234273 working-directory : ./npm
235274 run : bun install --frozen-lockfile
236275
237- - name : Transpile TS -> JS
276+ - name : Typecheck
238277 working-directory : ./npm
239- run : bun run build
278+ run : bun tsc --project tsconfig.json --noEmit
240279
241- - name : Publish Meta
280+ - name : Publish Meta Packages
242281 working-directory : ./npm
243- run : bun run ./scripts/publish.ts ./@foundry-rs/forge
282+ run : |
283+ set -euo pipefail
284+ bun ./scripts/publish-meta.mjs --release-version "$RELEASE_VERSION"
244285 env :
245286 PROVENANCE : true
246287 VERSION_NAME : ${{ env.RELEASE_VERSION }}
0 commit comments