Skip to content

Commit 49e5c98

Browse files
committed
chore: add GitHub Actions workflow to release packages
- add "Release" workflow - add `release-please` configuration
1 parent 03923fc commit 49e5c98

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
name: Run Release Please
11+
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
outputs:
19+
releases_created: ${{ steps.release.outputs.releases_created }}
20+
paths_released: ${{ steps.release.outputs.paths_released }}
21+
22+
steps:
23+
- name: Run release-please command
24+
id: release
25+
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f
26+
27+
build-and-publish:
28+
name: Build & Publish
29+
30+
runs-on: ubuntu-latest
31+
32+
needs: [release-please]
33+
34+
if: needs.release-please.outputs.paths_released != '[]'
35+
36+
strategy:
37+
matrix:
38+
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
39+
40+
permissions:
41+
contents: read
42+
id-token: write
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Setup pnpm
49+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
50+
51+
- name: Setup NodeJS
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: latest
55+
cache: pnpm
56+
registry-url: "https://registry.npmjs.org"
57+
58+
- name: Install dependencies
59+
run: pnpm i --frozen-lockfile
60+
61+
- name: Build packages
62+
run: pnpm -r build
63+
64+
- name: Publish package at ${{ matrix.path }}
65+
run: npm publish --provenance --access public
66+
working-directory: ${{ matrix.path }}
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-please-manifest.json

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

release-please-config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"separate-pull-requests": true,
5+
"always-update": true,
6+
"packages": {}
7+
}

0 commit comments

Comments
 (0)