Skip to content

Commit 17b1a98

Browse files
authored
ci(publish): automatically increase package version and create release notes + publish in npm with provenance (#13)
1 parent adc20fc commit 17b1a98

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,31 @@ on:
22
push:
33
branches:
44
- 'main'
5-
5+
permissions:
6+
# Needed by googleapis/release-please-action@v4
7+
contents: write
8+
pull-requests: write
69
jobs:
710
publish:
811
runs-on: ubuntu-latest
912
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-node@v3
13+
- name: 🍄 Bump package version, create GitHub release and changelog
14+
uses: googleapis/release-please-action@v4
15+
id: release
1216
with:
13-
node-version: 12
14-
- run: npm install
15-
- run: npm test
16-
- uses: JS-DevTools/npm-publish@v1
17+
release-type: node
18+
- uses: actions/checkout@v4
19+
if: ${{ steps.release.outputs.release_created }}
20+
- uses: actions/setup-node@v4
21+
if: ${{ steps.release.outputs.release_created }}
1722
with:
18-
token: ${{ secrets.NPM_TOKEN }}
23+
node-version: lts/*
24+
registry-url: https://registry.npmjs.org
25+
- name: 🚀 Publish to npm
26+
if: ${{ steps.release.outputs.release_created }}
27+
run: |
28+
npm install
29+
npm run build --if-present
30+
npm publish --provenance
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)