1- name : Publish NPM
1+ name : npm
22
33on :
44 workflow_dispatch :
@@ -22,6 +22,7 @@ defaults:
2222env :
2323 ACTIONS_RUNNER_DEBUG : true
2424 NPM_CONFIG_PROVENANCE : true
25+ NPM_REGISTRY_URL : " https://registry.npmjs.org"
2526
2627jobs :
2728 publish-arch :
@@ -54,31 +55,38 @@ jobs:
5455 }}
5556 outputs :
5657 RELEASE_VERSION : ${{ steps.release-version.outputs.RELEASE_VERSION }}
57- env :
58- NPM_REGISTRY_URL : " https://registry.npmjs.org"
5958 steps :
6059 - name : Checkout
6160 uses : actions/checkout@v5
6261
62+ - name : Set Isolated Artifact Directory
63+ id : set-artifact-dir
64+ # Use RUNNER_TEMP env var to persist ARTIFACT_DIR across steps
65+ run : echo "ARTIFACT_DIR=$RUNNER_TEMP/foundry_artifacts" >> "$GITHUB_ENV"
66+
67+ - name : Prepare Isolated Artifact Directory
68+ run : |
69+ mkdir -p "$ARTIFACT_DIR"
70+ ls -la "$ARTIFACT_DIR" || true
71+
6372 - name : Download Release Assets
6473 uses : actions/download-artifact@v5
6574 with :
6675 merge-multiple : true
6776 # Download all foundry artifacts from the triggering release run
6877 pattern : " foundry_*"
69- path : foundry_artifacts
78+ # Extract artifacts into an isolated temp directory, not the workspace
79+ path : ${{ runner.temp }}/foundry_artifacts
7080 github-token : ${{ secrets.GITHUB_TOKEN }}
7181 run-id : ${{ github.event.workflow_run.id || inputs.run_id }}
7282
7383 - name : Setup Bun
74- uses : oven-sh/setup-bun@main
84+ uses : oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
7585 with :
7686 bun-version : latest
77- registries : |
78- https://registry.npmjs.org
7987
8088 - name : Setup Node (for npm publish auth)
81- uses : actions/setup-node@v4
89+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
8290 with :
8391 node-version : " 24"
8492 registry-url : " https://registry.npmjs.org"
@@ -102,12 +110,12 @@ jobs:
102110 run : |
103111 set -euo pipefail
104112
105- echo "Artifacts in foundry_artifacts :"
106- ls -la ../foundry_artifacts || true
113+ echo "Artifacts in $ARTIFACT_DIR :"
114+ ls -la "$ARTIFACT_DIR" || true
107115
108116 # Derive RELEASE_VERSION from any foundry artifact we downloaded
109117 # Expected names: foundry_<VERSION>_<platform>_<arch>.{tar.gz,zip}
110- first_file=$(ls ../foundry_artifacts /foundry_* 2>/dev/null | head -n1 || true)
118+ first_file=$(ls "$ARTIFACT_DIR" /foundry_* 2>/dev/null | head -n1 || true)
111119 if [[ -z "${first_file}" ]]; then
112120 echo "No foundry artifacts found to publish" >&2
113121 exit 1
@@ -125,20 +133,20 @@ jobs:
125133 RELEASE_VERSION : ${{ steps.release-version.outputs.RELEASE_VERSION }}
126134 run : |
127135 set -euo pipefail
128- mkdir -p tmp
136+ mkdir -p "$ARTIFACT_DIR/ tmp"
129137
130- FILE_PREFIX="../foundry_artifacts /foundry_${RELEASE_VERSION}_${{ matrix.os }}_${{ matrix.arch }}"
138+ FILE_PREFIX="$ARTIFACT_DIR /foundry_${RELEASE_VERSION}_${{ matrix.os }}_${{ matrix.arch }}"
131139 if [[ -f "${FILE_PREFIX}.zip" ]]; then
132140 echo "Extracting ${FILE_PREFIX}.zip"
133141 if ! command -v unzip >/dev/null 2>&1; then
134142 sudo apt-get update -y && sudo apt-get install -y unzip
135143 fi
136- unzip -o "${FILE_PREFIX}.zip" -d . /tmp
137- BIN=. /tmp/forge.exe
144+ unzip -o "${FILE_PREFIX}.zip" -d "$ARTIFACT_DIR /tmp"
145+ BIN="$ARTIFACT_DIR /tmp/forge.exe"
138146 else
139147 echo "Extracting ${FILE_PREFIX}.tar.gz"
140- tar -xzf "${FILE_PREFIX}.tar.gz" -C . /tmp
141- BIN=. /tmp/forge
148+ tar -xzf "${FILE_PREFIX}.tar.gz" -C "$ARTIFACT_DIR /tmp"
149+ BIN="$ARTIFACT_DIR /tmp/forge"
142150 fi
143151
144152 echo "Staging binary $BIN into @foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
@@ -193,23 +201,20 @@ jobs:
193201 name : Publish Meta Package
194202 runs-on : ubuntu-latest
195203 env :
196- RELEASE_VERSION : ${{ needs.publish-arch.outputs.RELEASE_VERSION }}
197204 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
198205 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
199- NPM_REGISTRY_URL : " https://registry.npmjs.org "
206+ RELEASE_VERSION : ${{ needs.publish-arch.outputs.RELEASE_VERSION }}
200207 steps :
201208 - name : Checkout
202209 uses : actions/checkout@v5
203210
204211 - name : Setup Bun
205- uses : oven-sh/setup-bun@main
212+ uses : oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
206213 with :
207214 bun-version : latest
208- registries : |
209- https://registry.npmjs.org
210215
211216 - name : Setup Node (for npm publish auth)
212- uses : actions/setup-node@v4
217+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
213218 with :
214219 node-version : " 24"
215220 registry-url : " https://registry.npmjs.org"
0 commit comments