Skip to content

Comments

Add wasm binary to release pipeline#16743

Merged
Mossaka merged 1 commit intomainfrom
feat/wasm-release-pipeline
Feb 19, 2026
Merged

Add wasm binary to release pipeline#16743
Mossaka merged 1 commit intomainfrom
feat/wasm-release-pipeline

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 19, 2026

Summary

  • Adds gh-aw.wasm (WebAssembly compiler) and wasm_exec.js (Go runtime) to the release build script
  • Both artifacts land in dist/ and are automatically included in GitHub release assets and checksums
  • Uses wasm-opt for size optimization when available (consistent with make 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.sh so every release includes:

Asset Description
gh-aw.wasm WebAssembly compiler module (~15 MB)
wasm_exec.js Go's Wasm runtime (required to load the module)

No changes needed to the release workflow itself — the existing gh release create "$RELEASE_TAG" dist/* command picks up the new files automatically.

Test plan

  • Ran bash scripts/build-release.sh v0.0.0-test locally — confirmed gh-aw.wasm and wasm_exec.js appear in dist/ with correct checksums
  • CI passes (build, lint, tests)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings February 19, 2026 04:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.wasm as part of scripts/build-release.sh
  • Optionally optimize the Wasm binary with wasm-opt -Oz when available
  • Copy Go’s wasm_exec.js runtime into dist/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" \
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
-ldflags="-s -w" \
-ldflags="-s -w -X main.version=${VERSION} -X main.isRelease=true" \

Copilot uses AI. Check for mistakes.
Comment on lines 95 to 104
# 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
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka merged commit 2027cf6 into main Feb 19, 2026
47 checks passed
@Mossaka Mossaka deleted the feat/wasm-release-pipeline branch February 19, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant