Skip to content

Commit f941e5c

Browse files
committed
ci: add release-please workflow for automated NPM publishing
Automatic version bumping from conventional commits for the skillx CLI package.
1 parent ad062f6 commit f941e5c

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

.github/workflows/release-cli.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release CLI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs['packages/cli--release_created'] }}
16+
tag_name: ${{ steps.release.outputs['packages/cli--tag_name'] }}
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
publish:
24+
needs: release-please
25+
if: needs.release-please.outputs.release_created == 'true'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: pnpm/action-setup@v4
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
registry-url: https://registry.npmjs.org
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build CLI
41+
run: pnpm --filter skillx build
42+
43+
- name: Publish to NPM
44+
run: pnpm --filter skillx publish --no-git-checks --access public
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"packages/cli": "0.1.0"
3+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"deploy": "pnpm --filter web deploy",
99
"seed": "node scripts/seed-skills.mjs"
1010
},
11+
"packageManager": "pnpm@10.22.0",
1112
"engines": {
1213
"node": ">=20"
1314
},

release-please-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"packages": {
3+
"packages/cli": {
4+
"release-type": "node",
5+
"package-name": "skillx",
6+
"changelog-path": "CHANGELOG.md",
7+
"bump-minor-pre-major": true,
8+
"bump-patch-for-minor-pre-major": true
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)