Skip to content

Commit 9d2ac73

Browse files
authored
chore: add semi-automated publishing with release-please (#152)
1 parent 009e72d commit 9d2ac73

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# adapted from https://github.com/googleapis/release-please-action#automating-publication-to-npm
2+
on:
3+
push:
4+
branches:
5+
- main
6+
name: release-please
7+
jobs:
8+
release-please:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: googleapis/release-please-action@v4
12+
id: release
13+
with:
14+
release-type: node
15+
# The logic below handles the npm publication:
16+
- uses: actions/checkout@v4
17+
# these if statements ensure that a publication only occurs when
18+
# a new release is created:
19+
if: ${{ steps.release.outputs.release_created }}
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
registry-url: 'https://registry.npmjs.org'
24+
if: ${{ steps.release.outputs.release_created }}
25+
- run: corepack enable
26+
if: ${{ steps.release.outputs.release_created }}
27+
- run: yarn --immutable
28+
if: ${{ steps.release.outputs.release_created }}
29+
- run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
32+
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)