Skip to content

ci: switch publishing to npm Trusted Publishing, drop pinax infra#2126

Merged
lutter merged 7 commits into
mainfrom
lutter/ci
May 19, 2026
Merged

ci: switch publishing to npm Trusted Publishing, drop pinax infra#2126
lutter merged 7 commits into
mainfrom
lutter/ci

Conversation

@lutter
Copy link
Copy Markdown
Collaborator

@lutter lutter commented May 18, 2026

Summary

Migrate publishing to npm Trusted Publishing (OIDC) and remove all pinax-network infrastructure from CI.

The Snapshot Release workflow has been failing on every PR with E404 Not Found - PUT https://registry.npmjs.org/@graphprotocol%2fgraph-cli. Root cause: the NPM_TOKEN belongs to a pinax-network bot that no longer has publish rights on the package (current _npmUser is
yaroshkvorets; registered maintainers are nasmr and neysofu, none of which are graphprotocol accounts). The OIDC handshake succeeds and provenance is signed and uploaded to sigstore — only the actual PUT to the registry fails because it uses the stale token.

This change:

  • Drops NPM_TOKEN entirely in favor of npm Trusted Publishing (OIDC). No long-lived publish credentials remain.
  • Consolidates release.yml + pr.yml + shared-release-snapshot.yml into a single publish.yml because npmjs.com Trusted Publisher accepts exactly one workflow filename per package. Two jobs gated by event type: stable (push to main) and snapshot (pull_request).
  • Replaces pinax-network/changesets-release-action with upstream changesets/action@v1. Bot commits are now authored by github-actions[bot] and signed by GitHub's web-flow key, which preserves the "Verified" badge without needing GPG secrets in the repo.
  • Replaces pinax-network/changesets-snapshot-action with a few inline changeset version --snapshot / changeset publish --tag --no-git-tag calls — that's all the action was doing internally.
  • Replaces pinax-network/changesets-dependencies-action with mscharley/dependency-changesets-action@v1 (actively maintained; latest release 2026-03). The the-guild-org upstream is unmaintained since 2023-02.
  • Drops the pinax-bot GPG signing, the crazy-max/ghaction-import-gpg step, and the four PINAX_BOT_* / NPM_TOKEN secrets.
  • Bumps publish jobs to Node 24 because npm Trusted Publishing requires npm ≥ 11.5.1 (ships with Node ≥ 22.14.0); Node 24 matches what upstream changesets does for the same reason (Use modern npm version in publish jobs to enable trusted publishing changesets/changesets#1847). The ci.yml test matrix is unchanged (still Node 20/22).
  • Removes the misnamed shared-*.yml "reusable" workflows. They were only ever called from this repo's own pr.yml — not actually shared.

Net diff: 6 files, +151 / −278 lines of YAML.

Test plan

  • Push branch, confirm ci.yml (lint, cli tests, ts tests, event-handler tests) still passes
  • Open a test PR with a trivial changeset; confirm Publish / snapshot job mints an OIDC token, prints Signed provenance statement, and publishes @graphprotocol/graph-cli@-alpha- without an E404
  • Verify the sigstore transparency log entry references repo:graphprotocol/graph-cli and publish.yml
  • npm install @graphprotocol/graph-cli@alpha from a scratch directory, run graph --version
  • Trigger a Renovate PR (or wait for next one) and confirm changeset-deps.yml commits a .changeset/*.md authored by github-actions[bot] with the "Verified" badge
  • Merge to main, verify Publish / stable opens the "Upcoming Release Changes" PR
  • Merge that PR, verify stable release publishes with provenance and no NPM_TOKEN referenced
  • After step above succeeds, delete repo secrets: NPM_TOKEN, PINAX_BOT_GITHUB_TOKEN, PINAX_BOT_PGP_PRIVATE_KEY, PINAX_BOT_PGP_PASSPHRASE

Replace the broken NPM_TOKEN-based publish path with npm OIDC Trusted
Publishing. The token belonged to a pinax-network bot that no longer
has publish rights on @graphprotocol/graph-cli, causing snapshot
releases to fail with E404 despite valid OIDC provenance being signed.

Consolidate stable releases and alpha/rc snapshots into a single
publish.yml because npmjs.com Trusted Publisher accepts only one
workflow filename per package. Move auto-changesets for Renovate PRs
to mscharley/dependency-changesets-action (actively maintained); the
old the-guild-org upstream is unmaintained since 2023.

Drop all pinax-network infrastructure: actions, bot identity, GPG
signing secrets, and the misnamed "shared" workflow files (they were
only used by this repo). Bot commits are now authored by
github-actions[bot] and signed by GitHub's web-flow key via
changesets/action, preserving the "Verified" badge.

Requires Trusted Publisher to be registered on npmjs.com for both
@graphprotocol/graph-cli and @graphprotocol/graph-ts before merging,
pointing at workflow filename publish.yml. The NPM_TOKEN,
PINAX_BOT_GITHUB_TOKEN, and PINAX_BOT_PGP_* secrets can be removed
from repo settings after the first stable release succeeds.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 7fe67ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Lift the release commit message into an env var so the inline
  `chore(release):` colon no longer breaks YAML's plain-scalar rules
  in `if:` conditions (prettier's parser was rejecting the file).
- Drop `githubReleaseName` and `githubReleaseAssets` — those were
  pinax-fork extensions, not inputs on upstream `changesets/action@v1`.
- Re-add asset upload as a follow-up step using `gh release upload`,
  gated on `steps.changesets.outputs.published`. Recent stable
  releases (0.97.0, 0.98.0) had hundreds of binary downloads, so
  this behavior should not regress.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 18, 2026

Deploying graph-tooling with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fe67ac
Status: ✅  Deploy successful!
Preview URL: https://82349e85.graph-tooling.pages.dev
Branch Preview URL: https://lutter-ci.graph-tooling.pages.dev

View logs

lutter added 5 commits May 18, 2026 15:08
`@changesets/changelog-github` (the configured changelog generator)
calls the GitHub REST API to enrich entries with PR and user info, and
fails closed with `Please create a GitHub personal access token` when
no token is set. The old pinax snapshot action injected GITHUB_TOKEN
implicitly; the inlined version has to set it explicitly on the
version and publish steps.

The "Package X must depend on the current version" messages in the
same log are harmless warnings about ignored example packages
(.changeset/config.json: ignore=[example-*]) and were also present in
the prior pinax-driven runs.
GitHub will force Node.js 20 actions to Node.js 24 starting
2026-06-02 and remove Node 20 from runners on 2026-09-16. The
deprecation warning called out two actions used by the composite
setup-node:

- pnpm/action-setup@v4.2.0 → bumped to v6 (drop-in; same inputs).
- styfle/cancel-workflow-action@0.12.1 → removed entirely. It's been
  superseded by GitHub's built-in `concurrency:` keyword. Add
  matching concurrency groups to ci.yml (cancel PR runs, preserve
  main) and changeset-deps.yml (cancel per-PR). publish.yml already
  has concurrency on both jobs.

Also pin mscharley/dependency-changesets-action to v1.2.4 — the
action publishes specific patch tags but no floating v1.
The hardhat node in examples/ethereum-basic-event-handlers/hardhat
runs with `"hardhat": "^2.22.1"` and no lockfile, so each CI run
picks the latest matching release (currently 2.28.6). Hardhat 2.26+
defaults to the Prague hardfork, which enforces EIP-7825's per-
transaction gas cap of 2^24 (16,777,216). The test contract deploy
needs ~30M gas and gets rejected with `ProviderError: Transaction
gas limit is 30000000 and exceeds transaction gas cap of 16777216`.

Pinning the in-container network's hardfork to `cancun` restores
pre-EIP-7825 behavior without locking the hardhat version.
…round

Link #2127 from the cancun-hardfork comment so anyone touching the
file finds the tracking ticket for the proper fix (deterministic
hardhat version via lockfile or pinned version).
Node 20 reached EOL on 2026-04-30. Bump the declared minimum to Node 22
(22.11.0 for the CLI package), replace Node 20 with Node 22 in the
single-version CI jobs, and shift the CLI test matrix from [20, 22] to
[22, 24] so what we test matches what publish.yml already ships on.
@lutter lutter merged commit 7fe67ac into main May 19, 2026
12 of 14 checks passed
@lutter lutter deleted the lutter/ci branch May 19, 2026 19:46
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