beads/.github/workflows/release.yml
ecuthiell 02a416cc73
fix: make release-version checks shell-free (#5614)
* fix: make release-version checks shell-free (#5533)

Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell

* fix(release): preserve checker status and explain gate failures (saa-cgh.16)

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell

* docs: retain release-pinned CLI references (saa-cgh.16)

Preserve corrected live preflight help while generated references continue to match docs/cli-docs.pin v1.2.2. Fix the exact two-line hosted docs-policy failure without changing pin authority.

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell

* fix(versioncheck): carry base's release gates into the Go checker

The base branch gained three release-metadata gates in scripts/check-versions.sh
after this PR's merge point (release: prep v1.3.0, b3ef65c854): the Copilot
plugin manifest, the four winres.json Windows PE version fields, and
manifest.xml's assemblyIdentity version. This PR replaces that shell body with
the Go authority, so adopting it as-written would have silently dropped all
three — each one guards a file whose bump is a sed anchored on the old value,
so a drifted copy no-ops and ships advertising the previous version.

Port them into internal/versioncheck so the shell-free checker enforces the
same set:

- source gains an optional expected() so a surface can derive its required
  value; the Windows PE numeric fields must be purely numeric and so carry the
  prerelease-stripped form, and manifest.xml carries the four-part form.
- readWinresVersionField reads the nested RT_VERSION resource path through the
  existing duplicate-key-checked JSON helpers.
- readManifestAssemblyVersion anchors on line start, since the XML declaration
  also carries a version attribute.

Also regenerate the Bazel BUILD files (make bazel-sync). cmd/bd/BUILD.bazel
enumerates srcs explicitly, so the PR's new preflight_versions.go was missing
from it and //cmd/bd:bd_lib failed to compile with `undefined:
runBeadsVersionSyncCheck`; gazelle adds that src, the //internal/versioncheck
dep edge, and BUILD files for the two new packages.

Known follow-up for review: the PR's TestRepositoryReleaseVersionsMatch and
TestPrePushHookOrdinaryPushWorksWithSystemBash read repository files directly,
so they need `data` runfiles to pass under `bazel test` (advisory lane only).

* fix(versioncheck): stop the release gate over-claiming docs coverage; distinguish --expect mismatch

Maintainer review fixup for iteration 1 (both findings minor, non-gating;
scorecard 915/850 approve with Required Changes: None).

Contract & Interface Fidelity (claude + codex): the success line claimed
"Version files and released-docs policy pass" while the checker reads no
documentation surface, and it replaced the shell predecessor's explicit
disclaimer that the docs release line and docs/cli-docs.pin are manual
release steps. Restore the base wording ("Version files in sync at: <v>")
plus the disclaimer, and update the three pins in main_test.go.

This also repairs a consumer neither review lane censused: the tracked
release runbook .beads/formulas/beads-release.formula.toml:475 instructs the
operator that the gate "must print `✓ Version files in sync at: <version>`
before you continue" — the renamed string had silently broken that
acceptance check. Grepping the new spelling finds nothing; the breakage only
shows up when grepping the old one.

Error Handling & Resilience (codex): --expect mismatch reused exit 1, so
.githooks/pre-push answered a tag/checkout mismatch with the version-drift
remedy ("Fix with: scripts/update-versions.sh <version>") — advice that
would rewrite every release surface to the wrong version. Give that case
status 3 and add the matching hook branch pointing at CONTRIBUTING's actual
rule. Only two --expect call sites exist: release.yml:45 (bare non-zero
check, unaffected) and this hook.

Verified at this head: check-versions.sh rc=0 (24 green rows, all three
ported base gates); exit taxonomy 0/2/3 as documented; go test
./internal/versioncheck/ ./scripts/check-versions/ PASS=65 FAIL=0 SKIP=0;
cmd/bd TestTrackedManagedHookSectionsMatchGenerator ok (hook edit sits above
the generator-managed markers); gofmt/vet clean. Both fixes proven
non-vacuous by mutating each back and requiring red.

Declined as out of cleanup scope, recorded for follow-up: making
TestRepositoryReleaseVersionsMatch fixture-based (redesigns the PR's own
test architecture and interacts with the deliberate untracked-discovery pin
at check_test.go:174; harm measured local-only) and declaring bazel data
runfiles (gate impact none — no BAZEL key in either CI_GATE_REQUIRED map at
this base; the remedy needs root filegroups that touch
scripts/bazel_policy_test.go invariants).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(versioncheck): declare the release-gate tests' repo inputs as Bazel data

Base commit e1b2e79484 (#6941) promoted the seven BAZEL* lanes into pr.yml's
CI_GATE_REQUIRED after this branch's merge point, so the two packages this PR
adds are now graded by a required check. Both reach real repository files
through a hand-rolled filepath.Join("..", ".."), which resolves outside the
runfiles tree, and `bazel test //...` failed on them:

  TestRepositoryReleaseVersionsMatch
    open ../../cmd/bd/version.go: no such file or directory
  TestPrePushHookOrdinaryPushWorksWithSystemBash
    runfiles .githooks/pre-push: No such file or directory

Resolve the root through internal/testutil/bazeltest.RepoRoot, the base's
helper for exactly this, which reduces to the previous behavior under plain
`go test`; and declare the inputs as data through a //:release_metadata_files
filegroup aggregating the surfaces versioncheck.releaseSources gates, the
canonical version it compares them against, the uv.lock pin and the tracked
hooks, exported from the packages that own them. The filegroup is hand-listed
because releaseSources is itself a closed list: a newly gated surface must be
added there too, and until it is the test fails under Bazel.

The shell entrypoint's exit-status subtests build the checker from source at
the repository root, which cannot work against a runfiles tree that has no
go.mod, so they skip under Bazel and keep running under `go test`. The guard
sits inside each subtest, not above the loop, so the ordinary-push assertion
still reports as run rather than hiding behind a skip.

Validation: `go test ./internal/versioncheck/ ./scripts/check-versions/` is
unchanged at 65 pass / 0 skip, with all three entrypoint subtests still
executing; both targets pass `bazel test --config=ci`; //scripts:scripts_test
(the tag-taxonomy and Bazel policy tests) passes; `bazel build //...` is clean
across 321 targets; `make bazel-sync` reports no drift and is idempotent.

* test(versioncheck): stop declaring the bazelignored npm manifest as Bazel data

The required `Bazel / test` lane failed on the refreshed head in fork-PR CI:

  TestRepositoryReleaseVersionsMatch
    npm package.json: open .../versioncheck_test.runfiles/_main/
    npm-package/package.json: no such file or directory (expected 1.3.0)

npm-package/ is in .bazelignore (#6798), so Bazel never links it into the
execroot, and a local sandbox cannot stage npm-package/package.json even
though //:release_metadata_files named it and analysis accepted the label.
It resolved only under remote execution, where the client uploads the file
from the workspace. That is how the previous fixup's `bazel test
--config=ci` passed on a host whose bazelrc defaults to remote execution.
Fork PRs get no remote-execution secrets, so CI runs the test in
processwrapper-sandbox, where it fails.

Drop the entry from the filegroup. Under Bazel only, let
TestRepositoryReleaseVersionsMatch tolerate exactly that surface's absence:
the file must be missing, and every other gated surface, the uv.lock pin and
the hook markers must pass. The test logs the gap. This mirrors the base's
skipReleaseFormulaUnderBazel for the bazelignored .beads/. `go test`, which
sees the real checkout, still checks the npm manifest.

Validation: forcing local execution the way fork CI runs (`bazel test
--config=ci --nocache_test_results --remote_executor=
--strategy=TestRunner=processwrapper-sandbox`) reproduced the failure before
the change. After it, //internal/versioncheck:versioncheck_test,
//scripts/check-versions:check-versions_test and //scripts:scripts_test pass
(3 of 3 executed), and both release-gate targets also pass under remote
execution. Drifting a declared surface still fails the sandboxed run. The
tolerance was probed through TEST_SRCDIR and BEADS_TEST_REPO_ROOT: each of
these still fails:
- another drifted surface
- a present but mismatched npm manifest
- an unreadable canonical version
- plain `go test` with the manifest missing

`go test ./internal/versioncheck/ ./scripts/check-versions/`, golangci-lint
and `make bazel-sync-check` are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-01 07:46:37 -07:00

448 lines
17 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
# Manual dispatch is only for rerunning a release from a v* tag. Publishing
# jobs below are tag-gated and skip branch refs.
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
attestations: write
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
# Pre-publish gate: refuse to publish a release whose version constants and
# Docusaurus docs snapshot disagree. This blocks the failure mode where a tag
# ships with version.go bumped but the docs snapshot missing (which otherwise
# only surfaces as a red main after the artifacts are already published).
verify-version-consistency:
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
cache: false
- name: Verify tag and released versions
run: ./scripts/check-versions.sh --expect "${GITHUB_REF_NAME#v}"
release-package-mcp:
name: Release Package Gate (MCP)
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
needs: verify-version-consistency
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- name: Install uv
run: python -m pip install uv==0.11.16
- name: Run MCP package gate
run: make ci-package-mcp
- name: Upload validated MCP dist
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: release-mcp-dist
path: integrations/beads-mcp/dist/*
if-no-files-found: error
retention-days: 7
release-package-npm:
name: Release Package Gate (npm)
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
needs: verify-version-consistency
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
- name: Run npm package gate
run: make ci-package-npm
goreleaser:
# Guard: only run goreleaser in the canonical repository (not in forks)
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
needs:
- release-package-mcp
- release-package-npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Install cross-compilation toolchains and signing tools
# Backstop for a hang that escapes the inner `timeout` calls, so it has
# to sit ABOVE what those calls can legitimately consume: 3 update
# attempts x 120s + 2 backoffs x 10s + 300s install = 680s worst case.
# 13m leaves ~100s of headroom. This job sets no job-level
# timeout-minutes, so this cap is the only bound on a stuck apt.
timeout-minutes: 13
run: |
updated=""
for attempt in 1 2 3; do
if sudo timeout 120 apt-get \
-o Acquire::Retries=3 \
-o Acquire::http::Timeout=30 \
-o Acquire::https::Timeout=30 \
update; then
updated=yes
break
fi
echo "::warning::apt-get update attempt $attempt failed or timed out"
# No backoff after the final attempt - there is nothing left to wait for.
if [ "$attempt" -lt 3 ]; then
sleep 10
fi
done
# Deliberate best-effort: a stale index still installs these packages
# from the runner image cache far more often than not, and failing the
# job here would turn a transient mirror outage into a red build. The
# warning is what makes the degraded path visible in the job log.
if [ -z "$updated" ]; then
echo "::warning::apt-get update failed after 3 attempts; proceeding with cached index"
fi
sudo timeout 300 apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu osslsigncode
- name: Install go-winres for Windows PE resource embedding
run: go install github.com/tc-hib/go-winres@latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7
with:
distribution: goreleaser
version: '~> v2'
args: >
release --clean --parallelism 1
${{ github.repository != 'gastownhall/beads' && '--skip=publish --skip=announce' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Windows code signing (optional - signing is skipped if not set)
WINDOWS_SIGNING_CERT_PFX_BASE64: ${{ secrets.WINDOWS_SIGNING_CERT_PFX_BASE64 }}
WINDOWS_SIGNING_CERT_PASSWORD: ${{ secrets.WINDOWS_SIGNING_CERT_PASSWORD }}
- name: Verify no ICU runtime dependency on Linux binaries
run: |
for bin in dist/bd-linux-*/bd; do
[ -f "$bin" ] || continue
if ldd "$bin" 2>/dev/null | grep -qi icu; then
echo "ERROR: $bin has unexpected ICU runtime dependency" >&2
ldd "$bin" >&2
exit 1
fi
echo "OK: $bin has no ICU runtime dependency"
done
- name: Publish the contract corpus as a release artifact
# Ships the canonicalized golden corpus (cmd/bd/protocol/testdata/corpus)
# with each release and appends its checksum to the release checksums.txt,
# so a downstream consumer can anchor its vendored-corpus drift-check to a signed
# beads release rather than a self-recomputed manifest. Runs before the
# macOS job's serial checksums.txt append (goreleaser-macos needs this
# job), so the entry is preserved.
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
version="${tag#v}"
archive="beads_${version}_contract_corpus.tar.gz"
tar -czf "$archive" -C cmd/bd/protocol/testdata corpus
shasum -a 256 "$archive" | tee corpus-checksum.txt
gh release upload "$tag" "$archive" --clobber
gh release download "$tag" --pattern checksums.txt --dir /tmp/corpus-sums
sums=/tmp/corpus-sums/checksums.txt
# Idempotent on a job re-run (manual retry or flake): drop any prior
# entry for this archive before appending the fresh checksum, so the
# re-download+append never leaves a duplicate (or stale) corpus row.
if [ -f "$sums" ]; then
grep -vF "$archive" "$sums" > "$sums.tmp" || true
mv "$sums.tmp" "$sums"
fi
cat corpus-checksum.txt >> "$sums"
gh release upload "$tag" "$sums" --clobber
goreleaser-macos:
# Build macOS binaries with CGO_ENABLED=1 for embedded Dolt support.
# Runs on native macOS to avoid zig/osxcross cross-compilation issues.
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
needs: goreleaser
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
# Never restore a cache into release builds: setup-go's key is
# predictable and falls back to main's cache, whose module and build
# caches are not re-verified before binaries are built and signed.
cache: false
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Build darwin/arm64
env:
CGO_ENABLED: "1"
GOARCH: arm64
GOOS: darwin
run: |
go build -tags "gms_pure_go netgo" \
-ldflags "-s -w -X main.Version=${{ steps.version.outputs.version }} -X main.Build=$(git rev-parse --short HEAD) -X main.Commit=$(git rev-parse HEAD) -X main.Branch=$(git branch --show-current)" \
-o bd-darwin-arm64 ./cmd/bd
./scripts/verify-cgo.sh bd-darwin-arm64
# Verify no ICU runtime dependency leaked through
if otool -L bd-darwin-arm64 | grep -qi icu; then
echo "ERROR: bd-darwin-arm64 has unexpected ICU runtime dependency" >&2
otool -L bd-darwin-arm64 >&2
exit 1
fi
codesign -s - -f bd-darwin-arm64
- name: Build darwin/amd64
env:
CGO_ENABLED: "1"
GOARCH: amd64
GOOS: darwin
# macos-latest is arm64; cross-compile CGO C code for x86_64
CC: clang -arch x86_64
CXX: clang++ -arch x86_64
run: |
go build -tags "gms_pure_go netgo" \
-ldflags "-s -w -X main.Version=${{ steps.version.outputs.version }} -X main.Build=$(git rev-parse --short HEAD) -X main.Commit=$(git rev-parse HEAD) -X main.Branch=$(git branch --show-current)" \
-o bd-darwin-amd64 ./cmd/bd
./scripts/verify-cgo.sh bd-darwin-amd64
if otool -L bd-darwin-amd64 | grep -qi icu; then
echo "ERROR: bd-darwin-amd64 has unexpected ICU runtime dependency" >&2
otool -L bd-darwin-amd64 >&2
exit 1
fi
codesign -s - -f bd-darwin-amd64
- name: Smoke test embedded dolt (arm64 native)
run: |
# arm64 binary runs natively on macos-latest
bd="$(pwd)/bd-darwin-arm64"
tmpdir=$(mktemp -d)
projdir="$tmpdir/smoketest"
mkdir -p "$projdir"
cd "$projdir"
git init -b main
git config user.name "CI" && git config user.email "ci@test"
git commit --allow-empty -m "init"
"$bd" init --prefix smoketest
"$bd" create "smoke test" --type task
"$bd" list | grep -q "smoke test"
# Verify embedded mode (no server process)
if pgrep -f "dolt sql-server" >/dev/null 2>&1; then
echo "ERROR: unexpected dolt sql-server process running" >&2
exit 1
fi
echo "OK: embedded dolt smoke test passed"
cd - >/dev/null
rm -rf "$tmpdir"
- name: Package archives
run: |
version="${{ steps.version.outputs.version }}"
for arch in arm64 amd64; do
staging="beads_${version}_darwin_${arch}"
mkdir -p "$staging"
cp "bd-darwin-${arch}" "$staging/bd"
cp LICENSE README.md CHANGELOG.md "$staging/"
tar -czf "${staging}.tar.gz" -C "$staging" .
shasum -a 256 "${staging}.tar.gz" >> darwin-checksums.txt
done
- name: Upload to GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${{ steps.version.outputs.version }}"
for arch in arm64 amd64; do
gh release upload "v${version}" "beads_${version}_darwin_${arch}.tar.gz" --clobber
done
- name: Append checksums to release checksums.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${{ steps.version.outputs.version }}"
# Download existing checksums, append darwin entries, re-upload
gh release download "v${version}" --pattern checksums.txt --dir /tmp/checksums
cat darwin-checksums.txt >> /tmp/checksums/checksums.txt
gh release upload "v${version}" /tmp/checksums/checksums.txt --clobber
attest-release:
# Attest the complete release after GoReleaser assets and the native macOS
# archives have both populated checksums.txt.
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') }}
needs: [goreleaser, goreleaser-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Resolve release asset paths
id: assets
run: |
mkdir -p dist
echo "checksums=dist/checksums.txt" >> "$GITHUB_OUTPUT"
echo "sbom=dist/beads-${GITHUB_REF_NAME}.spdx.json" >> "$GITHUB_OUTPUT"
- name: Download release checksums
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release download "${GITHUB_REF_NAME}" --pattern checksums.txt --dir dist
- name: Generate release SBOM
uses: anchore/sbom-action@e22c389904149dbc22b58101806040fa8d37a610 # v0
with:
path: .
format: spdx-json
output-file: ${{ steps.assets.outputs.sbom }}
upload-artifact: false
upload-release-assets: false
- name: Upload release SBOM
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${GITHUB_REF_NAME}" "${{ steps.assets.outputs.sbom }}" --clobber
- name: Attest release artifacts
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4
with:
subject-checksums: ${{ steps.assets.outputs.checksums }}
- name: Attest release SBOM
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4
with:
subject-checksums: ${{ steps.assets.outputs.checksums }}
sbom-path: ${{ steps.assets.outputs.sbom }}
publish-pypi:
runs-on: ubuntu-latest
needs: [release-package-mcp, goreleaser]
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- name: Install uv
run: python -m pip install uv==0.11.16
- name: Download validated MCP dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: release-mcp-dist
path: integrations/beads-mcp/dist
- name: Verify validated MCP dist
run: |
test -n "$(find integrations/beads-mcp/dist -maxdepth 1 -type f -print -quit)"
ls -la integrations/beads-mcp/dist
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd integrations/beads-mcp
uv tool run twine upload dist/*
publish-npm:
runs-on: ubuntu-latest
needs: [release-package-npm, goreleaser, goreleaser-macos]
if: ${{ github.repository == 'gastownhall/beads' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') }}
permissions:
contents: read
id-token: write # Required for npm provenance/trusted publishing
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Update npm for OIDC trusted publishing
run: npm install -g npm@latest # Requires npm >= 11.5.1 for trusted publishing
- name: Publish to npm
run: |
cd npm-package
npm publish --access public
# Uses OIDC trusted publishing - no token needed
# Provenance attestations are automatic with trusted publishing