Skip to content

Commit eb48c25

Browse files
committed
feat: auto-publish to npm on release-please release created
1 parent 62a1841 commit eb48c25

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,47 @@ jobs:
1515
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 10
18+
outputs:
19+
release_created: ${{ steps.release.outputs.release_created }}
20+
tag_name: ${{ steps.release.outputs.tag_name }}
1821
steps:
1922
- uses: googleapis/release-please-action@v5
23+
id: release
2024
with:
2125
config-file: release-please-config.json
2226
manifest-file: release-please-manifest.json
27+
28+
publish:
29+
name: Publish to npm
30+
needs: release-please
31+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 15
34+
permissions:
35+
contents: read
36+
id-token: write
37+
steps:
38+
- uses: actions/checkout@v6
39+
with:
40+
ref: ${{ needs.release-please.outputs.tag_name }}
41+
42+
- uses: pnpm/action-setup@v6
43+
with:
44+
version: 9
45+
46+
- uses: actions/setup-node@v6
47+
with:
48+
node-version: "22"
49+
cache: "pnpm"
50+
registry-url: "https://registry.npmjs.org"
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
- name: Build
56+
run: pnpm build
57+
58+
- name: Publish
59+
run: cd packages/agent && pnpm publish --no-git-checks --access public
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)