From 79fc9c82f131bbb90381b1bd36593fed161ac781 Mon Sep 17 00:00:00 2001 From: sjsjsj1246 Date: Wed, 25 Mar 2026 17:24:31 +0900 Subject: [PATCH] =?UTF-8?q?[-]:=20publish=20=ED=9B=84=20github=20release?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 26 +++++++++++++++++++++++++- docs/releasing.md | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bcec289..16e5977 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ jobs: publish: runs-on: ubuntu-latest permissions: - contents: read + contents: write id-token: write steps: @@ -39,3 +39,27 @@ jobs: - name: Publish current main release run: pnpm release + + - name: Read package version + id: package_version + run: echo "version=$(node -p \"require('./package.json').version\")" >> "$GITHUB_OUTPUT" + + - name: Create Git tag if missing + run: | + TAG="v${{ steps.package_version.outputs.version }}" + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG already exists" + exit 0 + fi + git tag "$TAG" + git push origin "$TAG" + + - name: Create GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG="v${{ steps.package_version.outputs.version }}" + gh release create "$TAG" \ + --title "$TAG" \ + --generate-notes \ + --verify-tag diff --git a/docs/releasing.md b/docs/releasing.md index fa9108c..260b92d 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -80,6 +80,7 @@ Run `.github/workflows/publish.yml` manually when you want to ship the current v - `pnpm release` verifies tests, docs lint/build, size limits, and then runs `changeset publish`. - Publishing uses GitHub Actions OIDC via npm Trusted Publishing instead of an `NPM_TOKEN` secret. +- After npm publish succeeds, the workflow creates a `v` Git tag and a GitHub Release with generated release notes. ## Notes for this repo