From dfb8fb4f7329b754060339f10759dc4072c3b300 Mon Sep 17 00:00:00 2001 From: sjsjsj1246 Date: Wed, 25 Mar 2026 17:10:30 +0900 Subject: [PATCH] =?UTF-8?q?[-]:=20release=EC=99=80=20publish=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 7 ++----- docs/releasing.md | 12 +++++++++--- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5c34241 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.12.4 + + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Publish current main release + run: pnpm release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35cf747..9ff95a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,14 +4,12 @@ on: push: branches: - main - workflow_dispatch: jobs: - release: + release_pr: runs-on: ubuntu-latest permissions: contents: write - id-token: write pull-requests: write steps: @@ -35,11 +33,10 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Create release PR or publish to npm + - name: Create or update release PR uses: changesets/action@v1 with: version: pnpm version-packages - publish: pnpm release title: "[-]: version packages" commit: "[-]: version packages" env: diff --git a/docs/releasing.md b/docs/releasing.md index f116b9a..fa9108c 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -20,7 +20,8 @@ After that, the GitHub release workflow can publish without storing a long-lived 2. Add a changeset before opening or updating the PR. 3. Merge the PR into `main`. 4. Let the Release workflow open or update the version PR. -5. Merge the version PR to publish the new npm version and update `CHANGELOG.md`. +5. Merge the version PR to update `CHANGELOG.md` and package versions on `main`. +6. Run the `Publish` workflow manually when you want to ship that version to npm. ## Adding a changeset @@ -68,10 +69,15 @@ The normal path should be the GitHub Release workflow instead of local publishin ## What the release workflow does -On pushes to `main` or manual dispatch, `.github/workflows/release.yml` runs `changesets/action`. +On pushes to `main`, `.github/workflows/release.yml` runs `changesets/action`. - If unreleased changesets exist, it opens or updates a release PR. -- If the release PR has already been merged and version files are on `main`, it runs `pnpm release`. +- It does not publish to npm. + +## What the publish workflow does + +Run `.github/workflows/publish.yml` manually when you want to ship the current version on `main`. + - `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.