Skip to content

Commit 6d901c4

Browse files
authored
Merge pull request #20 from sjsjsj1246/codex/split-release-and-publish
[-]: release와 publish 워크플로 분리
2 parents f95a617 + dfb8fb4 commit 6d901c4

3 files changed

Lines changed: 46 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.12.4
23+
24+
- name: Use Node.js 22
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
cache: pnpm
29+
registry-url: https://registry.npmjs.org
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Publish current main release
35+
run: pnpm release

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch:
87

98
jobs:
10-
release:
9+
release_pr:
1110
runs-on: ubuntu-latest
1211
permissions:
1312
contents: write
14-
id-token: write
1513
pull-requests: write
1614

1715
steps:
@@ -35,11 +33,10 @@ jobs:
3533
- name: Install dependencies
3634
run: pnpm install --frozen-lockfile
3735

38-
- name: Create release PR or publish to npm
36+
- name: Create or update release PR
3937
uses: changesets/action@v1
4038
with:
4139
version: pnpm version-packages
42-
publish: pnpm release
4340
title: "[-]: version packages"
4441
commit: "[-]: version packages"
4542
env:

docs/releasing.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ After that, the GitHub release workflow can publish without storing a long-lived
2020
2. Add a changeset before opening or updating the PR.
2121
3. Merge the PR into `main`.
2222
4. Let the Release workflow open or update the version PR.
23-
5. Merge the version PR to publish the new npm version and update `CHANGELOG.md`.
23+
5. Merge the version PR to update `CHANGELOG.md` and package versions on `main`.
24+
6. Run the `Publish` workflow manually when you want to ship that version to npm.
2425

2526
## Adding a changeset
2627

@@ -68,10 +69,15 @@ The normal path should be the GitHub Release workflow instead of local publishin
6869

6970
## What the release workflow does
7071

71-
On pushes to `main` or manual dispatch, `.github/workflows/release.yml` runs `changesets/action`.
72+
On pushes to `main`, `.github/workflows/release.yml` runs `changesets/action`.
7273

7374
- If unreleased changesets exist, it opens or updates a release PR.
74-
- If the release PR has already been merged and version files are on `main`, it runs `pnpm release`.
75+
- It does not publish to npm.
76+
77+
## What the publish workflow does
78+
79+
Run `.github/workflows/publish.yml` manually when you want to ship the current version on `main`.
80+
7581
- `pnpm release` verifies tests, docs lint/build, size limits, and then runs `changeset publish`.
7682
- Publishing uses GitHub Actions OIDC via npm Trusted Publishing instead of an `NPM_TOKEN` secret.
7783

0 commit comments

Comments
 (0)