Conversation
The release build script now also produces gh-aw.wasm (the browser compiler) and bundles Go's wasm_exec.js runtime alongside it. Both land in dist/ and are automatically included in the GitHub release assets and checksums. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds WebAssembly artifacts to the release build output so they’re published as versioned GitHub release assets (and included in dist/ checksums).
Changes:
- Build
dist/gh-aw.wasmas part ofscripts/build-release.sh - Optionally optimize the Wasm binary with
wasm-opt -Ozwhen available - Copy Go’s
wasm_exec.jsruntime intodist/wasm_exec.js
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Building gh-aw WebAssembly binary..." | ||
| GOOS=js GOARCH=wasm go build \ | ||
| -trimpath \ | ||
| -ldflags="-s -w" \ |
There was a problem hiding this comment.
The released Wasm binary is built without any version/release metadata. In the current codebase the compiler defaults to defaultVersion="dev" and DetectActionMode() will therefore choose dev mode (local action refs like ./actions/setup), which will produce compiled workflows that won’t run in consumer repos. Consider embedding release/version info into the Wasm build (e.g., add version/isRelease vars to cmd/gh-aw-wasm similar to cmd/gh-aw, set workflow.SetDefaultVersion/SetVersion/SetIsRelease in its main(), and pass -X ... via this build step) or otherwise default the Wasm compiler to a consumer-safe action mode.
| -ldflags="-s -w" \ | |
| -ldflags="-s -w -X main.version=${VERSION} -X main.isRelease=true" \ |
| # Generate checksums file | ||
| echo "" | ||
| echo "Generating checksums..." | ||
| cd dist | ||
| # Use sha256sum if available (Linux), otherwise use shasum (macOS) | ||
| if command -v sha256sum &> /dev/null; then | ||
| sha256sum * > checksums.txt | ||
| elif command -v shasum &> /dev/null; then | ||
| shasum -a 256 * > checksums.txt | ||
| else |
There was a problem hiding this comment.
Checksum generation isn’t idempotent: sha256sum * > checksums.txt (and the shasum variant) will include a pre-existing checksums.txt in the glob on reruns, and the command also reads/writes the same file, producing incorrect checksums. Consider excluding checksums.txt from the input set (or generating to a temp file and moving it into place) and/or cleaning dist/ before writing new artifacts.
See below for a potential fix:
if command -v sha256sum &> /dev/null; then
rm -f checksums.txt
sha256sum * > checksums.txt
elif command -v shasum &> /dev/null; then
rm -f checksums.txt
Summary
gh-aw.wasm(WebAssembly compiler) andwasm_exec.js(Go runtime) to the release build scriptdist/and are automatically included in GitHub release assets and checksumswasm-optfor size optimization when available (consistent withmake build-wasm)Details
The wasm binary lets users compile workflows in the browser without a Go installation. Until now it was only built during CI checks and for the docs site — it was never published as a versioned release asset. This change adds it to
scripts/build-release.shso every release includes:gh-aw.wasmwasm_exec.jsNo changes needed to the release workflow itself — the existing
gh release create "$RELEASE_TAG" dist/*command picks up the new files automatically.Test plan
bash scripts/build-release.sh v0.0.0-testlocally — confirmedgh-aw.wasmandwasm_exec.jsappear indist/with correct checksums🤖 Generated with Claude Code