Skip to content

Commit 8c69e33

Browse files
authored
chore: replace manual publish with release-please (#772)
1 parent 035ec8e commit 8c69e33

5 files changed

Lines changed: 77 additions & 84 deletions

File tree

.github/workflows/publish.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
outputs:
18+
releases_created: ${{ steps.release.outputs.releases_created }}
19+
paths_released: ${{ steps.release.outputs.paths_released }}
20+
prs_created: ${{ steps.release.outputs.prs_created }}
21+
head_branch: ${{ fromJson(steps.release.outputs.pr || '{}').headBranchName }}
22+
steps:
23+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
24+
id: release
25+
26+
prettify-pr:
27+
runs-on: ubuntu-latest
28+
needs: release-please
29+
if: ${{ needs.release-please.outputs.prs_created == 'true' }}
30+
continue-on-error: true
31+
permissions:
32+
contents: write
33+
steps:
34+
- uses: actions/checkout@v6
35+
with:
36+
ref: ${{ needs.release-please.outputs.head_branch }}
37+
- uses: actions/setup-node@v6
38+
with:
39+
node-version: 'lts/*'
40+
- run: npm install
41+
- run: npx prettier --write .
42+
- name: Fix prettier on Release PR
43+
run: |
44+
git config user.name "github-actions[bot]"
45+
git config user.email "github-actions[bot]@users.noreply.github.com"
46+
git add .
47+
git commit -m "chore: fix code style issues"
48+
git push origin
49+
50+
publish:
51+
runs-on: ubuntu-latest
52+
needs: release-please
53+
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
54+
permissions:
55+
contents: read
56+
id-token: write # Required for npm provenance
57+
steps:
58+
- uses: actions/checkout@v6
59+
- uses: actions/setup-node@v6
60+
with:
61+
node-version: 'lts/*'
62+
registry-url: 'https://registry.npmjs.org'
63+
- run: npm install
64+
- run: npm test
65+
- name: Publish with provenance
66+
run: npm publish --provenance --access public

.github/workflows/release-version-pr.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.release-please-manifest.json

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

release-please-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"include-component-in-tag": false,
5+
"packages": {
6+
".": {}
7+
}
8+
}

0 commit comments

Comments
 (0)