Skip to content

Commit cacb0e2

Browse files
committed
ci: add release-please pipeline for changelog and npm publish
Add CI workflow (check/lint/test/build), release-please config and manifest anchored at 0.3.0, and a prepack build hook so publish ships a fresh dist. Mirrors the pi-repair-layer release automation pattern.
1 parent 1355104 commit cacb0e2

4 files changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- uses: pnpm/action-setup@v6
22+
23+
- uses: actions/setup-node@v6
24+
with:
25+
node-version: 22
26+
cache: pnpm
27+
28+
- run: pnpm install --frozen-lockfile
29+
30+
- name: Typecheck
31+
run: pnpm run check
32+
33+
- name: Lint
34+
run: pnpm run lint
35+
36+
- name: Test
37+
run: pnpm run test
38+
39+
- name: Build
40+
run: pnpm run build
41+
42+
release-please:
43+
needs: [check]
44+
if: github.ref == 'refs/heads/main'
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
issues: write
49+
pull-requests: write
50+
outputs:
51+
release_created: ${{ steps.release.outputs.release_created }}
52+
steps:
53+
- uses: googleapis/release-please-action@v5
54+
id: release
55+
with:
56+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
57+
config-file: release-please-config.json
58+
manifest-file: .release-please-manifest.json
59+
60+
publish:
61+
needs: release-please
62+
if: needs.release-please.result == 'success' && needs.release-please.outputs.release_created == 'true'
63+
runs-on: ubuntu-latest
64+
environment:
65+
name: Release
66+
url: https://www.npmjs.com/package/@r3b1s/tmux-pilot
67+
permissions:
68+
contents: read
69+
id-token: write
70+
steps:
71+
- uses: actions/checkout@v6
72+
73+
- uses: pnpm/action-setup@v6
74+
75+
- uses: actions/setup-node@v6
76+
with:
77+
node-version: 22
78+
registry-url: "https://registry.npmjs.org"
79+
cache: pnpm
80+
81+
- run: pnpm install --frozen-lockfile
82+
83+
- name: Publish
84+
env:
85+
NPM_CONFIG_PROVENANCE: true
86+
run: pnpm publish --access public --no-git-checks --provenance

.release-please-manifest.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"test": "vitest run",
4747
"lint": "biome check src/ test/",
4848
"format": "biome check --write src/ test/",
49+
"prepack": "pnpm run build",
4950
"clean": "rm -rf dist node_modules coverage"
5051
},
5152
"pi": {

release-please-config.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": { "component": "tmux-pilot" }
5+
},
6+
"include-v-in-tag": true,
7+
"include-component-in-tag": true,
8+
"release-type": "node",
9+
"changelog-sections": [
10+
{ "type": "feat", "section": "Features" },
11+
{ "type": "fix", "section": "Bug Fixes" },
12+
{ "type": "perf", "section": "Performance Improvements" },
13+
{ "type": "revert", "section": "Reverts" },
14+
{ "type": "docs", "section": "Documentation" },
15+
{ "type": "style", "section": "Styles", "hidden": true },
16+
{ "type": "chore", "section": "Miscellaneous Chores" },
17+
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
18+
{ "type": "test", "section": "Tests", "hidden": true },
19+
{ "type": "build", "section": "Build System", "hidden": true },
20+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
21+
]
22+
}

0 commit comments

Comments
 (0)