Skip to content

Commit 36e23a2

Browse files
committed
Update GitHub Actions for npm trusted publishing
1 parent 17f7389 commit 36e23a2

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/package-size-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515

1616
- name: Package size report
1717
uses: pkg-size/action@v1

.github/workflows/publish.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ jobs:
88
test:
99
name: Test
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
1113
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14+
- uses: actions/checkout@v6
15+
- uses: actions/setup-node@v6
1416
with:
1517
node-version: 24
1618
- uses: oven-sh/setup-bun@v2
@@ -26,9 +28,12 @@ jobs:
2628
name: Publish NPM
2729
needs: test
2830
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
id-token: write
2934
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-node@v4
35+
- uses: actions/checkout@v6
36+
- uses: actions/setup-node@v6
3237
with:
3338
node-version: 24
3439
registry-url: https://registry.npmjs.org/
@@ -38,17 +43,15 @@ jobs:
3843
- name: Install dependencies
3944
run: bun ci
4045
- name: Publish package to NPM
41-
run: npm publish
42-
env:
43-
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
46+
run: npm publish --provenance
4447

4548
# publish-gpr:
4649
# name: Publish GPR
4750
# needs: test
4851
# runs-on: ubuntu-latest
4952
# steps:
50-
# - uses: actions/checkout@v4
51-
# - uses: actions/setup-node@v4
53+
# - uses: actions/checkout@v6
54+
# - uses: actions/setup-node@v6
5255
# with:
5356
# node-version: 24
5457
# registry-url: https://npm.pkg.github.com/

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
node-version: [18, 20, 22, 24, 25]
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@v6
1717
with:
1818
node-version: ${{ matrix.node-version }}
1919
- name: Install Bun

RELEASING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ Releasing is handled by GitHub Actions and is powered by GitHub Releases.
22

33
1. Set the new version following the [semver](https://semver.org/) specification in `package.json`
44
2. Verify the package contents and size using `bun pm pack --dry-run`
5-
3. [Draft a new release](https://github.com/levibuzolic/eslint-plugin-no-only-tests/releases/new)
5+
3. Ensure npm trusted publishing is configured for this package on npmjs.com
6+
- Add a trusted publisher for `levibuzolic/eslint-plugin-no-only-tests`
7+
- Select the `publish.yml` workflow in `.github/workflows`
8+
4. [Draft a new release](https://github.com/levibuzolic/eslint-plugin-no-only-tests/releases/new)
69
- Set the tag version to the new version
710
- Set the release title to the new version
811
- Auto-generate the release notes, excluding any internal changes
9-
4. [Watch the release build](https://github.com/levibuzolic/eslint-plugin-no-only-tests/actions/workflows/publish.yml) and verify it completes successfully
10-
- CI installs and validates with Bun, then publishes to npm using `npm publish`
12+
5. [Watch the release build](https://github.com/levibuzolic/eslint-plugin-no-only-tests/actions/workflows/publish.yml) and verify it completes successfully
13+
- CI installs and validates with Bun, then publishes to npm using GitHub OIDC trusted publishing

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"author": "Levi Buzolic",
2222
"repository": {
2323
"type": "git",
24-
"url": "git@github.com:levibuzolic/eslint-plugin-no-only-tests.git"
24+
"url": "git+https://github.com/levibuzolic/eslint-plugin-no-only-tests.git"
2525
},
2626
"files": [
2727
"index.js",

0 commit comments

Comments
 (0)