From be6df11b13847deacc8b636ae058d39a5d1a4641 Mon Sep 17 00:00:00 2001 From: tomoemon Date: Sun, 17 May 2026 10:29:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20release=20workflow=20=E3=82=92?= =?UTF-8?q?=E6=89=8B=E5=8B=95=E5=AE=9F=E8=A1=8C=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=20workflow=5Fdispatch=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit release-tag workflow が GITHUB_TOKEN で GitHub release を作成すると release: published イベントが他の workflow をトリガーしないため、 npm publish の release workflow が起動しない。 手動でも publish できるよう workflow_dispatch を追加する。publish する バージョンは release イベント・手動実行のどちらもチェックアウトした package.json から取得するため、入力は不要。 - checkout の ref を release イベントはタグ、手動実行は対象ブランチ (通常 main) に切り替え - publish ステップの prerelease 判定は手動実行時スキップされないよう修正 - バージョンは package.json から取得するため version sync ステップを削除 Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef037a7..7d507f9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,7 @@ name: release on: release: types: [published] + workflow_dispatch: jobs: publish: @@ -13,7 +14,12 @@ jobs: id-token: write steps: + # release イベントはタグを、workflow_dispatch は実行対象ブランチ + # (通常は main) をチェックアウトする。publish するバージョンは + # どちらの場合もチェックアウトした package.json から取得する。 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: ${{ github.event.release.tag_name || github.ref }} - name: Setup Node.js 24.x uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: @@ -27,10 +33,6 @@ jobs: - run: pnpm run fmt:check - run: pnpm run test - run: pnpm run build - - name: Sync package.json version with release tag - run: | - VERSION="${GITHUB_REF_NAME#v}" - npm version "$VERSION" --no-git-tag-version --allow-same-version - name: Publish to npm - if: github.event.release.prerelease == false + if: github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false run: npm publish --provenance --access public From 3bce275fae61590c1673d14ce31fb5b76d10362d Mon Sep 17 00:00:00 2001 From: tomoemon Date: Sun, 17 May 2026 10:37:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20release=20workflow=20=E3=81=AB?= =?UTF-8?q?=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88=E9=9D=9E=E9=80=A3=E9=8E=96?= =?UTF-8?q?=E3=81=AE=E7=B5=8C=E7=B7=AF=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7d507f9..d90876b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,10 @@ name: release on: release: types: [published] + # release-tag workflow は GITHUB_TOKEN で GitHub release を作成するが、 + # GITHUB_TOKEN が起こしたイベントは他の workflow をトリガーしない仕様の + # ため、上の release: published では起動しない。手動で publish できるよう + # workflow_dispatch を用意している。 workflow_dispatch: jobs: