Skip to content

Commit 36bd5c3

Browse files
authored
ci: Use release-please to publish releases (#6)
1 parent 4ea5878 commit 36bd5c3

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
release_created: ${{ steps.release.outputs.release_created }}
19+
steps:
20+
- uses: googleapis/release-please-action@v4
21+
id: release
22+
with:
23+
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}
24+
config-file: release-please-config.json
25+
manifest-file: .release-please-manifest.json
26+
27+
npm-publish:
28+
needs: release-please
29+
if: ${{ needs.release-please.outputs.release_created }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: lts/*
36+
registry-url: 'https://registry.npmjs.org'
37+
- run: npm install -g npm@latest
38+
- run: npm publish --access public

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.1"
3+
}

release-please-config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bootstrap-sha": "1c22711a6e83410aba124e56d1a87e2d60f9c068",
4+
"packages": {
5+
".": {
6+
"pull-request-title-pattern": "chore: release v${version}",
7+
"release-type": "node"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)