Skip to content

refactor: migrate Node actions to runs.using=node24 + monorepo build pipeline#16

Merged
rqbazan merged 1 commit into
mainfrom
dev
May 19, 2026
Merged

refactor: migrate Node actions to runs.using=node24 + monorepo build pipeline#16
rqbazan merged 1 commit into
mainfrom
dev

Conversation

@rqbazan
Copy link
Copy Markdown
Member

@rqbazan rqbazan commented May 16, 2026

Summary

  • Migrate both monorepo-preview-release and railway-redeploy from composite (Bun-based) actions to native Node actions running on the runner's pre-installed Node 24 (runs.using: node24, pre-bundled dist/index.js).
  • monorepo-preview-release shells out to the real pnpm CLI via tinyexec for workspace listing, version bump, and publish — pnpm handles workspace:* / catalog: resolution, publishConfig overrides, lifecycle scripts (prepack / prepare), npm Trusted Publisher OIDC, and provenance signing. Keeps the three-mode auth flow (TOKEN_ONLY / OIDC_WITH_TOKEN_FALLBACK / OIDC_ONLY) and refuses to run on pull_request_target for safety.
  • railway-redeploy migrates inputs from the composite env-passing shim to core.getInput(). Pure HTTP / GraphQL via @urql/core; no shell-outs needed.
  • Add a monorepo-wide build / dist-sync pipeline: root mise.toml build aggregator → per-action ncc task with incremental sources / outputs tracking; lefthook pre-push hook blocks pushes whose actions/*/dist is stale; new Check actions dist sync CI workflow enforces the same on every PR.
  • Refresh root README with the Node action convention and rewrite the monorepo-preview-release README to match the final implementation (drop the Docker-era "self-contained" claim; document the new setup-pnpm + pnpm install prerequisite; flag the pull_request_target refusal).

Test plan

  • mise run build produces a deterministic dist/index.js for both actions (rebuild → byte-identical).
  • mise run check (biome + tsc) clean across both actions; dist/ excluded from lint/typecheck noise.
  • Local lefthook pre-push hook verified by force-pushing the squash of this PR's history — the hook validated actions/*/dist sync before the push went through.
  • CI workflow Check actions dist sync passes on this PR (~20s).
  • End-to-end on variableland/dx PR #219 with the new setup-pnpm step in the consumer workflow: prepack: pnpm build runs inside the publish flow, the published tarball includes the built dist/, and a downstream pnpm install in @vlandoss/env resolves cleanly (no ERR_PNPM_WORKSPACE_PKG_NOT_FOUND).

🤖 Generated with Claude Code

@rqbazan rqbazan added invalid This doesn't seem right and removed invalid This doesn't seem right labels May 17, 2026
…pipeline

Both `monorepo-preview-release` and `railway-redeploy` move from
composite actions (Bun-based) to native Node actions running on the
runner's pre-installed Node 24 with a pre-bundled `dist/index.js`. The
migration is paired with a monorepo-wide build / dist-sync pipeline so
the bundles stay in lockstep with `src/`.

monorepo-preview-release:

- action.yml: `runs.using: node24`, `main: dist/index.js`.
- src shells out to the real pnpm CLI via tinyexec (workspace listing,
  version bump, publish) instead of reimplementing those flows. pnpm
  handles workspace:* / catalog: resolution, publishConfig overrides,
  lifecycle scripts, npm Trusted Publisher OIDC, and provenance signing.
- The three-mode auth flow (TOKEN_ONLY / OIDC_WITH_TOKEN_FALLBACK /
  OIDC_ONLY) is preserved; each branch picks the right pnpm publish
  flags. A transient ~/.npmrc auth line is written for NPM_TOKEN mode
  and restored in a finally block.
- Refuses to run on pull_request_target (unsafe with PR head checkout
  + publish secrets — see security notes in README).
- Caller now needs setup-pnpm (or corepack enable) + pnpm install
  before invoking the action so lifecycle scripts (prepack/prepare
  doing `pnpm build`) find their devDeps.

railway-redeploy:

- action.yml: composite → `runs.using: node24`, `main: dist/index.js`.
- Inputs migrated from env-passing shim to core.getInput().
- Pure HTTP/GraphQL via @urql/core, no shell-outs needed.

Monorepo build pipeline:

- Root mise.toml gains a `build` aggregator that fans out to each
  action's local build task (`ncc build src/index.ts -o dist`).
- Mise's incremental sources/outputs tracking skips no-op rebuilds.
- lefthook adds a pre-push hook that runs `mise run build` and blocks
  the push if any actions/*/dist is out of sync.
- New CI workflow `Check actions dist sync` enforces the same invariant
  on every PR via jdx/mise-action@v2.
- Each action's biome.json excludes dist/; tsconfig.json adds nodenext
  module resolution + rewriteRelativeImportExtensions (preserves the
  project's .ts import style through ncc) and excludes dist/node_modules.

Docs: root README documents the Node action convention. The
monorepo-preview-release README is rewritten end-to-end to match the
final implementation (drop the Docker-era "self-contained, no setup
needed" claim, document the new setup-pnpm + pnpm install prerequisite,
and the pull_request_target refusal).

Net change on monorepo-preview-release/package.json: ~12 deps dropped
(libnpmpack, libnpmpublish, @pnpm/releasing.exportable-manifest, the
@pnpm/workspace.* family, npm-registry-fetch, ini, @npmcli/run-script,
npm-package-arg, semver, @pnpm/network.auth-header,
@pnpm/config.nerf-dart, @pnpm/pkg-manifest.reader, @pnpm/types, plus
their @types/* devDeps). Added: tinyexec (runtime), @vercel/ncc +
typescript (devDeps).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rqbazan rqbazan changed the title chore: dockerize actions and refresh READMEs refactor: migrate Node actions to runs.using=node24 + monorepo build pipeline May 19, 2026
@rqbazan rqbazan merged commit 08a9f16 into main May 19, 2026
1 check passed
@rqbazan rqbazan deleted the dev branch May 19, 2026 01:04
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