[gha] Publish eas-cli pointer packages instead of moving npm dist-tags - #4146
Closed
szdziedzic wants to merge 2 commits into
Closed
[gha] Publish eas-cli pointer packages instead of moving npm dist-tags#4146szdziedzic wants to merge 2 commits into
szdziedzic wants to merge 2 commits into
Conversation
… from CI npm restricted `npm dist-tag add` for access tokens, so CI can no longer move the latest-eas-build and latest-eas-build-staging tags. CI can still publish with OIDC trusted publishing, and every publish moves the published package's `latest` tag. Add eas-cli-for-eas-build and eas-cli-for-eas-build-staging pointer packages that pin an exact eas-cli version as a dependency, publish the staging pointer on release, gate the production pointer on the worker system tests, and replace the manual move-eas-build-tag workflow with a dispatchable pointer publish workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
✅ Thank you for adding the changelog entry! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4146 +/- ##
=======================================
Coverage 62.43% 62.43%
=======================================
Files 1009 1009
Lines 45735 45735
Branches 9621 9621
=======================================
Hits 28548 28548
Misses 15726 15726
Partials 1461 1461 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Thanks @szdziedzic ! I came up with an alternative way of fixing this without any NPM dependency, see ENG-25633 . Let's sync up tomorrow and discuss. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
npm restricted sensitive operations for access tokens in August 2026. CI can no longer run
npm dist-tag add, so the release flow fails to move thelatest-eas-buildandlatest-eas-build-stagingtags (see the v21.5.0 run). The tags are currently moved by hand after a Slack reminder (9276e22), andmove-eas-build-tag.ymlonly works in dry-run mode.CI can still run
npm publishwith OIDC trusted publishing (in use since #3342), and every publish moves the published package'slatestdist-tag. This PR rebuilds the pointer mechanism on top of that one allowed operation.How
New pointer packages in
pointer-packages/:eas-cli-for-eas-build— pins theeas-cliversion for production EAS Build infrastructure.eas-cli-for-eas-build-staging— same for staging.Each package pins an exact
eas-cliversion independenciesand ships a small bin that forwards to the pinned CLI. Thelatestversion of each package is the pointer.pointer-packages/publish.mjs(dependency-free Node script) stamps the version (1.0.<epoch seconds>) and theeas-clipin, verifies the pinned version exists on the registry (with retries), and publishes staging before production.New workflow
publish-eas-cli-pointer.yml(reusable + manually dispatchable): publishes the pointers for any existingeas-cliversion withtarget(staging/production/both) anddry_runinputs. It replacesmove-eas-build-tag.yml(deleted) for promotion and rollback.Release flow (
release.yml): afterlerna publish, CI now publishes the staging pointer → runs the worker system tests → publishes the production pointer, mirroring the staged rollout inworker.yml. A system-test failure leaves production pinned to the previous version; recovery is a manual dispatch ofpublish-eas-cli-pointer.yml.Version-source fix: the old tag steps (and the current Slack reminder) read the version from
lerna.json. Lerna bumps only changed packages, so that version may not exist foreas-cli— the v21.5.1 run was green but shipped noeas-cli@21.5.1(latestis still 21.5.0), so the reminder asked for tags npm rejects with 404. The new flow readspackages/eas-cli/package.jsoninstead, and the existence check inpublish.mjsfails loudly instead of pointing at a missing version.Not in this PR (follow-ups)
resolveEasCommandPrefixAndEnvAsync()inpackages/build-tools/src/utils/easCli.ts). A follow-up PR switches it to the pointer packages; until that ships and the worker is redeployed, the release flow keeps posting the Slack reminder to move the legacy tags manually (now with the corrected version).pointer-packages/README.md: confirm the package names are free on npm, publish both packages once manually (first publish of a new package may not work via trusted publishing), and configure trusted publishers for both packages (repoexpo/eas-cli, workflowpublish-eas-cli-pointer.yml; if npm validates the caller workflow for reusable workflows, also addrelease.yml).EasCliNpmTagsin@expo/eas-build-job.Test Plan
node pointer-packages/publish.mjs --eas-cli-version 21.5.0 --target both --dry-run— resolves the version, stamps both packages, andnpm publish --dry-runpacks them (staging first):--eas-cli-version 21.5.1(not on the registry) retries 5× and exits non-zero — the guard for the lerna.json/eas-cli version mismatch above.yarn lintandyarn fmt:checkpass.dry_run: truedispatch ofpublish-eas-cli-pointer.yml, then a realstaging-only publish once the one-time npm setup is done.🤖 Generated with Claude Code