fix(ci): publish 後の GitHub Release 自動作成#292
Merged
Merged
Conversation
v1.0.6 で GitHub Release の手動作成が漏れていたため、 sparkle-design-cli / sparkle-design-internal の publish.yml と同じ方式 (npm publish 成功後に CHANGELOG.md の該当セクションを release notes として自動でタグ付け・Release 作成)を移植した。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Publish to npm workflow に、npm publish 成功後の git tag 作成/Push と GitHub Release 自動作成(CHANGELOG セクションを release notes に使用)を追加し、手動運用で発生した Release 作成漏れを再発防止する PR です。あわせて、CHANGELOG から特定バージョンのセクション本文を抽出する Node スクリプトを導入しています。
Changes:
publish.ymlにcontents: writeを付与し、publish 後に tag push +gh release createを実行scripts/extract-changelog-section.mjsを追加し、CHANGELOG の該当バージョン本文を抽出して release notes に利用- CHANGELOG の Unreleased に今回の自動化内容を追記
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/publish.yml |
publish 後に tag/Release を自動作成するステップと Summary を追加 |
scripts/extract-changelog-section.mjs |
CHANGELOG の ## [X.Y.Z] セクション本文抽出ロジックを追加 |
CHANGELOG.md |
Unreleased に CI 自動化の変更点を記載 |
Comment on lines
+50
to
+57
| if git rev-parse --verify "refs/tags/${TAG}" >/dev/null 2>&1; then | ||
| echo "tag ${TAG} already exists locally — skipping git tag push" | ||
| else | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git tag "${TAG}" | ||
| git push origin "${TAG}" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Publish to npmworkflow(publish.yml)はnpm publishするだけで、git tag / GitHub Release の作成は含まれていなかった。そのため v1.0.6 の npm publish は成功したが GitHub Release が作られずに漏れていた(sparkle-design-internal で同種の問題(v1.2.0/v1.3.0)が見つかり、そちらを先に修正した際に本リポジトリでも同じ欠落があることが判明)。sparkle-design-cliのpublish.ymlは同じ問題を経験して自動化済みだったため、同じ方式を移植する。変更内容
.github/workflows/publish.ymlpermissions.contentsをread→write(tag push / release作成のため)npm publish成功後に以下を行う新ステップを追加:package.jsonの version からvX.Y.Zタグを作成・push(既存ならスキップ、再実行安全)CHANGELOG.mdの該当バージョンセクションを release notes としてgh release create(セクションが無ければ fallback note + warning)scripts/extract-changelog-section.mjsをsparkle-design-cliから移植補足
git tag+gh release createにより遡って手動作成済み(v1.0.6)Test plan
actionlint .github/workflows/publish.yml— クリーンnode scripts/extract-changelog-section.mjs 1.0.6で CHANGELOG.md の該当セクションが正しく抽出されることを確認format:checkの失敗は本変更と無関係(git stashで確認済み、既存の pre-existing issue。CI では別途 green の実績あり)このPRはレビュー・マージ待ちです。
https://claude.ai/code/session_01EvX77iPPYBEShCQ6NmDkmQ