Skip to content

Commit a426b22

Browse files
committed
ci: GitHub release only; npm publish stays local
1 parent 86965b6 commit a426b22

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ on:
55
tags:
66
- "v*.*.*"
77

8+
permissions:
9+
contents: write
10+
811
jobs:
9-
publish:
10-
name: publish to npm
12+
github-release:
13+
name: create GitHub release
1114
runs-on: ubuntu-latest
12-
permissions:
13-
contents: read
14-
id-token: write
1515
steps:
1616
- uses: actions/checkout@v4
17+
1718
- uses: pnpm/action-setup@v4
1819
with:
1920
version: 10
21+
2022
- uses: actions/setup-node@v4
2123
with:
2224
node-version: "20"
23-
registry-url: "https://registry.npmjs.org"
2425
cache: pnpm
2526

2627
- name: Install
@@ -32,7 +33,7 @@ jobs:
3233
- name: Build
3334
run: pnpm build
3435

35-
- name: Verify package matches tag
36+
- name: Verify package version matches tag
3637
run: |
3738
PKG_VERSION=$(node -p "require('./package.json').version")
3839
TAG_VERSION="${GITHUB_REF_NAME#v}"
@@ -41,7 +42,7 @@ jobs:
4142
exit 1
4243
fi
4344
44-
- name: Publish to npm
45-
run: pnpm publish --access public --no-git-checks --provenance
46-
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
- name: Create GitHub release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
generate_release_notes: true

CONTRIBUTING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,18 @@ Conventional commits are nice but not enforced. A short imperative summary is fi
4242

4343
## Releasing (maintainers)
4444

45-
1. Bump `version` in `package.json`.
46-
2. Push a `vX.Y.Z` tag.
47-
3. The `release.yml` workflow runs the tests and publishes to npm.
45+
1. Bump `version` in `package.json` and commit to `main`.
46+
2. Push a `vX.Y.Z` tag — CI runs tests and creates the [GitHub Release](https://github.com/false200/Tooltrim/releases).
47+
3. Publish to npm locally (not from CI):
48+
49+
```bash
50+
pnpm install
51+
pnpm test
52+
pnpm build
53+
pnpm publish --access public
54+
```
55+
56+
You must be logged in to npm (`npm login`) and own the `tooltrim` package.
4857

4958
## Reporting issues
5059

0 commit comments

Comments
 (0)