Skip to content

Commit f42eead

Browse files
authored
fix: ensure WASM sha in docs matches released binary (#432)
Upload the WASM as a versioned artifact in gen-release-pr.yml, then download that same artifact in release.yml instead of fetching a fresh build. This guarantees the SHA embedded in the docs during the release-prep PR matches the SHA of the published WASM.
1 parent 8bea7f6 commit f42eead

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/gen-release-pr.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ jobs:
172172
echo "Re-generated documentation"
173173
git status
174174
175+
- name: Upload wasm as release candidate
176+
if: steps.version-update.outputs.new-version != ''
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: wasm-${{ steps.version-update.outputs.new-version }}
180+
path: plugin.wasm
181+
175182
- name: Generate PR body
176183
if: steps.version-update.outputs.new-version != ''
177184
env:

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ jobs:
4646
fetch-depth: 0
4747
ref: ${{ github.event.workflow_run.head_sha }}
4848

49-
- name: Download artifact
50-
uses: dawidd6/action-download-artifact@v6
51-
with:
52-
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
workflow: build.yml
54-
workflow_conclusion: success
55-
name: wasm-file
56-
5749
- name: Extract version from commit message
5850
id: extract-version
5951
run: |
6052
VERSION=$(git log -1 --pretty=%B | grep -oP 'Release Prep \Kv[0-9]+\.[0-9]+\.[0-9]+')
6153
echo "Extracted version: $VERSION"
6254
echo "version=$VERSION" >> $GITHUB_OUTPUT
6355
56+
- name: Download wasm
57+
uses: dawidd6/action-download-artifact@v6
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
workflow: gen-release-pr.yml
61+
workflow_conclusion: success
62+
name: wasm-${{ steps.extract-version.outputs.version }}
63+
6464
- name: Calculate sha256
6565
run: |
6666
SHA256_HASH=$(sha256sum plugin.wasm | awk '{ print $1 }')

0 commit comments

Comments
 (0)