Skip to content

Commit 46ef0bf

Browse files
authored
ci: add release please for release automation (#24)
1 parent 91b1e21 commit 46ef0bf

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: 'Release Please'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write # See issue https://github.com/googleapis/release-please-action/issues/1105
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
with:
20+
# NOTE: GITHUB_TOKEN doesn't run checks on Release PR
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
# The logic below handles the npm publication:
24+
- uses: actions/checkout@v4
25+
# these if statements ensure that a publication only occurs when
26+
# a new release is created:
27+
if: ${{ steps.release.outputs.release_created }}
28+
29+
- name: Setup node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
registry-url: 'https://registry.npmjs.org'
34+
if: ${{ steps.release.outputs.release_created }}
35+
36+
- name: Install Dependencies
37+
run: npm ci
38+
if: ${{ steps.release.outputs.release_created }}
39+
40+
- name: Build
41+
run: npm run build
42+
if: ${{ steps.release.outputs.release_created }}
43+
44+
- name: Publish to NPM
45+
run: npm publish --access public
46+
env:
47+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
48+
if: ${{ steps.release.outputs.release_created }}

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"0.2.0"}

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+
"include-component-in-tag": false,
4+
"packages": {
5+
".": {}
6+
},
7+
"pull-request-header": "Release PR",
8+
"pull-request-title-pattern": "chore: release v${version}",
9+
"release-type": "node"
10+
}

0 commit comments

Comments
 (0)