Skip to content

Commit b21c616

Browse files
authored
ci: Switch to trusted publishing (#207)
* ci: Switch to trusted publishing * update npm only when a release is created
1 parent eaecaf4 commit b21c616

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/workflows/release-please.yml @eslint/eslint-tsc

.github/workflows/release-please.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
push:
33
branches:
44
- main
5+
56
name: release-please
67
jobs:
78
release-please:
@@ -30,11 +31,16 @@ jobs:
3031
node-version: lts/*
3132
registry-url: https://registry.npmjs.org
3233
if: ${{ steps.release.outputs.release_created }}
33-
- run: npm install
34+
35+
# npm 11.5.1 or later is required so update to latest to be sure
36+
- name: Update npm
37+
run: npm install -g npm@latest
3438
if: ${{ steps.release.outputs.release_created }}
35-
- run: npm publish --provenance
36-
env:
37-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
40+
- name: Publish to npm
41+
run: |
42+
npm install
43+
npm publish --provenance
3844
if: ${{ steps.release.outputs.release_created }}
3945

4046
# Post to social media

0 commit comments

Comments
 (0)