Skip to content

ci: npm publish を release-tag workflow の後続ジョブに統合#55

Merged
tomoemon merged 1 commit into
mainfrom
ci/merge-publish-into-release-tag
May 17, 2026
Merged

ci: npm publish を release-tag workflow の後続ジョブに統合#55
tomoemon merged 1 commit into
mainfrom
ci/merge-publish-into-release-tag

Conversation

@tomoemon

Copy link
Copy Markdown
Owner

Summary

  • npm-publish.yaml を削除し、publish 処理を release-tag.yaml 内の publish ジョブとして統合
  • release-tag ジョブに version / created の outputs を追加
  • publish ジョブは needs: release-tag + if: created == 'true' で、新規タグ作成時のみ実行
  • permissions はジョブ単位で分離(tag 用 contents: write / publish 用 id-token: write

設計の背景

PR #52 で publish を独立 workflow に分離したが、release: published トリガーは「GITHUB_TOKEN が起こしたイベントは他 workflow をトリガーしない」という GitHub の仕様で発火しない。このため自動 publish が機能せず、workflow_dispatch による手動実行が事実上必須になっていた。

publish を同一 workflow の後続ジョブ(needs: release-tag)にすれば、ジョブ間依存はクロス workflow トリガー制約の対象外となり、自動 publish がそのまま動作する。仕様回避のための長いコメントと workflow_dispatch フォールバックも不要になる。

検討した代替案

  • release-tag.yamlworkflow_dispatch を追加して手動 publish 経路を残す案: 再 publish の保険にはなるが、現状 GITHUB_TOKEN 起因の自動 release では使えていない経路であり、自動経路に一本化するシンプルさを優先して見送った。
  • npm-publish.yamlworkflow_dispatch 専用の手動ツールとして残す案: 同上の理由で不要と判断。

Test plan

  • package.json の version 変更を main に push し、tag/release 作成 → publish が同一 run 内で連結することを確認
  • 同一バージョンのまま push した場合に publish ジョブがスキップされることを確認

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tomoemon
tomoemon merged commit 6764cf4 into main May 17, 2026
1 check passed
@tomoemon
tomoemon deleted the ci/merge-publish-into-release-tag branch May 17, 2026 05:52
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