Skip to content

ci(cli-auth): add main/publish workflows and rename package to cli-auth - #15

Merged
xiaoyijun merged 3 commits into
masterfrom
xiaoyijun-add-publish-workflow
Apr 20, 2026
Merged

xiaoyijun merged 3 commits into
masterfrom
xiaoyijun-add-publish-workflow

Conversation

@xiaoyijun

@xiaoyijun xiaoyijun commented Apr 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add .github/workflows/main.yml: runs build, typecheck, and test on every push to master and every PR, across Node 22 and 24.
  • Add .github/workflows/publish.yml: publishes cli-auth to npm with provenance on v*.*.* tags (or manual workflow_dispatch).
  • Rename package from @logto-io/cli-auth → cli-auth (unscoped, matching the npm-registered name). Updates all imports, the samples workspace dep, and the README.
  • Add prepack script + repository field to packages/cli-auth/package.json for clean npm publishes.

Required repo configuration (action items for maintainers)

Before the publish workflow can run successfully, a maintainer must add one secret to the repo:

  • NPM_AUTOMATION_TOKEN — an npm Automation access token with publish rights to the cli-auth package. Add it under Settings → Secrets and variables → Actions → New repository secret.

Provenance signing (--provenance) uses GitHub's OIDC token, which is already granted via permissions.id-token: write in the workflow — no extra setup needed.

Release flow

Once the secret is configured, a release is cut by:

  1. Bumping the version in packages/cli-auth/package.json (currently 0.0.0) via a regular PR.
  2. After merge, tag the commit: git tag v0.1.0 && git push origin v0.1.0.
  3. The publish workflow runs automatically; the package appears on npm as cli-auth with a provenance attestation.

workflow_dispatch is available as a fallback for manual runs.

Test plan

  • pnpm -r build passes locally
  • pnpm -r typecheck passes locally
  • pnpm -r test passes locally (138 tests)
  • Samples resolve cli-auth via workspace after rename (pnpm install clean)
  • After merge, verify the Main workflow runs green on master
  • Maintainer adds NPM_AUTOMATION_TOKEN secret
  • Dry-run: push a pre-release tag or use workflow_dispatch to confirm the publish job works end-to-end

Add GitHub Actions workflows for continuous integration and npm
publishing, plus the publishing metadata (`publishConfig`, `repository`,
`prepack`) required for the scoped `@logto-io/cli-auth` package.
Use the unscoped `cli-auth` name that was registered on npm. Drop the
now-unnecessary `publishConfig.access: public` (unscoped packages are
public by default) and update all imports, workspace dependencies, and
docs accordingly.
@xiaoyijun xiaoyijun changed the title ci(cli-auth): add main and publish workflows ci(cli-auth): add main/publish workflows and rename package to cli-auth Apr 20, 2026
The `silverhand-io/actions-node-pnpm-run-steps` action always forwards a
`pnpm-version` input to `pnpm/action-setup@v4`, which rejects mismatches
against the `packageManager` field in `package.json`. Bump the local
declaration to `pnpm@10.8.0` so both sources agree.
@xiaoyijun
xiaoyijun merged commit 2e8f893 into master Apr 20, 2026
2 checks passed
@xiaoyijun
xiaoyijun deleted the xiaoyijun-add-publish-workflow branch April 20, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant