Skip to content

ci: move npm releases to admin-dispatched GitHub Actions (OIDC trusted publishing) - #4056

Draft
noomorph wants to merge 1 commit into
masterfrom
infra/oidc-release
Draft

noomorph wants to merge 1 commit into
masterfrom
infra/oidc-release

Conversation

@noomorph

Copy link
Copy Markdown
Contributor

Description

Replaces the Buildkite-driven, NPM_TOKEN-based publisher of react-native-ui-lib and uilib-native with an admin-dispatched Release GitHub Actions workflow that publishes through npm trusted publishing (GitHub OIDC). This is a port of the contract introduced in wix/react-native-navigation#8366, adapted to this monorepo:

  • Two packages, ordered: uilib-native first (only when native_version is given, or for snapshots), then react-native-ui-lib. Resume skips packages whose registry bytes already match the artifact; versions are never incremented to recover.
  • "uilib-native": "workspace:*" is rewritten to the planned (or npm latest) native version before npm pack; the packed manifest is checked for leftover workspace: ranges.
  • The in-tree build (yarn build) rewrites packages/ in place, so the release commit (version fields only) and its Git bundle are created from the clean tree before building.
  • Package-qualified tags react-native-ui-lib@<v> / uilib-native@<v> on the source commit; GitHub release named after the bare react-native-ui-lib version; version PR ci/update-version-<v> with the release label.
  • Release notes are grouped by head-branch prefix (feat/, web/, fix/, infra/) using each PR's ## Changelog section, matching prReleaseNotesCommon.js (which is shipped in the package and left untouched).
  • New Release checks workflow runs the node:test suite, a clean Linux yarn build, and pack-check for both packages on PRs.

Removed: scripts/release/release.js, releaseUtils.js, their Jest spec, the token-based scripts/release/.npmrc, root release / test:releaseScript scripts. Added repository to uilib-native (required for provenance).

Out of scope (left untouched, listed in docs/RELEASING.md as follow-up): demo/, docuilib/, eslint-rules/ publishers; the stale peerDependencies.uilib-native snapshot range.

Open questions for maintainers (why this is a draft):

  1. The workflow releases from master. The old flow tagged on the release branch (308 commits ahead of master, not an ancestor), and deployDocs.yml deploys only from release. Should the release branch be release instead? (One-line change in scripts/release/uilib.cjs + workflow guard.)
  2. Existing react-native-ui-lib@* tags are not reachable from master; the first kind=release run needs a baseline tag (documented in docs/RELEASING.md, step 5). Snapshots need none.
  3. The version-PR branch is named ci/update-version-<v> like RNN; the local yarn constraints pre-push hook only allows feat|web|fix|infra/ prefixes (the workflow pushes without hooks, so it is unaffected). Rename to infra/update-version-<v> if preferred.
  4. release.yml does not run yarn test (lint + jest): jest is unreliable after the destructive build and slow before it; the Buildkite status on the exact commit is the test gate.

One-time setup (npm trusted publishers for both packages, npm-release environment, RELEASE_PUBLISH_ENABLED, Buildkite cleanup) is documented in docs/RELEASING.md. Nothing publishes until that is done.

Changelog

none

Additional info

…usted publishing

Replaces the Buildkite-driven, NPM_TOKEN-based publisher of react-native-ui-lib
and uilib-native with a manually dispatched Release workflow on master, ported
from react-native-navigation's release contract: dry-run / publish / resume,
immutable artifacts, npm trusted publishing via GitHub OIDC, registry-integrity
recovery, package-qualified tags, GitHub release, and a version PR.
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Description Validation Passed

All required sections are properly filled out:

  • ✅ Description
  • ✅ Changelog
  • ✅ Additional info

Your PR is good for review! 🚀


This validation ensures all sections from the PR template are properly filled.

This branch has not been deployed

No deployments
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