Skip to content

ci: npmのTrusted Publishingワークフローを追加 - #2

Merged
Sinhalite merged 1 commit into
mainfrom
codex/add-publish-workflow
Oct 14, 2026
Merged

Sinhalite merged 1 commit into
mainfrom
codex/add-publish-workflow

Conversation

@Sinhalite

Copy link
Copy Markdown
Collaborator

概要

初回リリースに向けて、npm公開用のGitHub Actionsを追加します。
初回リリース手順の公開ワークフロー追加に対応します。
構成はJS SDKのrelease.ymlを参考にしています。

変更内容

  • .github/workflows/publish.ymlを追加
    • v*タグのpushで起動
    • タグとpackage.jsonのバージョン一致、対象コミットがmainに含まれることを検査
    • Lint・フォーマット・テスト・カバレッジ・型・配布物とTypeScript6の互換性を検査してから公開
    • GitHubホストのNode.js24系でOIDCを使い、npmへlatestとして公開
    • id-token: writeは公開ジョブのみに付与
    • 初期登録用の0.0.0とプレリリース版の公開は拒否
  • package.jsonに正式なrepository.urlを追加
  • DEVELOPMENT.mdに公開ワークフローと初回公開手順を記載

確認

  • npm run lint
  • npm run format
  • npm run test:coverage:134件成功、カバレッジ下限達成
  • npm run test:types
  • npm run test:package
  • actionlintによるワークフローの構文・設定検査
  • タグ検査:正式版の一致を許可、不一致・0.0.0・プレリリース版を拒否

公開までの残作業

このPRのマージではnpm公開は実行されません。バージョンも初期登録用の0.0.0を維持しています。

  1. マージ後、手元でnpm publish --tag bootstrapを実行して初期登録
  2. npmのTrusted Publisherにmicrocmsio/microcms-ts-typegenのpublish.ymlを登録し、npm publishを許可(Environmentは空欄)
  3. 1.0.0への変更PRをマージし、CI成功後にv1.0.0タグを作成・push

Trusted Publishingの公式仕様に従い、npmトークンは使用しません。

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b034aa4. Configure here.

Comment thread .github/workflows/publish.yml Resolved
@Sinhalite
Sinhalite merged commit ffeddef into main Oct 14, 2026
6 checks passed
@Sinhalite
Sinhalite deleted the codex/add-publish-workflow branch October 14, 2026 06:19
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