Skip to content

Commit a777fd1

Browse files
authored
ci: automate releases (#5186)
Fixes #5159
1 parent ac5574e commit a777fd1

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.github/release-please/config.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/v16.12.0/schemas/config.json",
3+
"release-type": "node",
4+
"include-component-in-tag": false,
5+
"changelog-sections": [
6+
{ "type": "feat", "section": "🌟 Features", "hidden": false },
7+
{ "type": "fix", "section": "🩹 Fixes", "hidden": false },
8+
{ "type": "docs", "section": "📚 Documentation", "hidden": false },
9+
10+
{ "type": "chore", "section": "🧹 Chores", "hidden": false },
11+
{ "type": "perf", "section": "🧹 Chores", "hidden": false },
12+
{ "type": "refactor", "section": "🧹 Chores", "hidden": false },
13+
{ "type": "test", "section": "🧹 Chores", "hidden": false },
14+
15+
{ "type": "build", "section": "🤖 Automation", "hidden": false },
16+
{ "type": "ci", "section": "🤖 Automation", "hidden": true }
17+
],
18+
"packages": {
19+
".": {}
20+
}
21+
}

.github/release-please/manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"10.7.0"}

.github/workflows/release-please.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release_please:
13+
name: release-please
14+
runs-on: ubuntu-latest
15+
outputs:
16+
releaseCreated: ${{ steps.release.outputs.release_created }}
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
steps:
21+
- uses: googleapis/release-please-action@v4
22+
id: release
23+
with:
24+
config-file: .github/release-please/config.json
25+
manifest-file: .github/release-please/manifest.json
26+
27+
npm_publish:
28+
name: Publish to npm
29+
runs-on: ubuntu-latest
30+
environment: npm
31+
needs: release_please
32+
if: needs.release_please.outputs.releaseCreated
33+
permissions:
34+
id-token: write
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
show-progress: false
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: lts/*
42+
registry-url: 'https://registry.npmjs.org'
43+
44+
- name: Install dependencies
45+
run: npm ci --ignore-scripts --force --no-fund --no-audit
46+
47+
- run: npm publish --provenance --access public
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)