Skip to content

Commit 5cea678

Browse files
committed
feat(ci): add automated releases with git-cliff and npm trusted publishing
- Add git-cliff config for conventional commit changelog generation - Add release workflow to auto-bump version and tag on merge to main - Add publish workflow with OIDC trusted publishing and provenance - Add retroactive CHANGELOG.md covering v1.0.0 through v1.4.0 - Skip release commits in CI to avoid redundant runs - Add publishConfig.access for scoped package publishing - Revert version to 1.4.0 for git-cliff to auto-determine next bump
1 parent c650fbb commit 5cea678

File tree

6 files changed

+320
-45
lines changed

6 files changed

+320
-45
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: CI
2+
13
on:
24
push:
35
branches: ['main']
@@ -9,79 +11,48 @@ concurrency:
911
cancel-in-progress: true
1012

1113
jobs:
12-
lint:
13-
name: Lint Check
14+
check:
15+
name: Lint, Format & Test
1416
runs-on: ubuntu-latest
17+
18+
# Skip release commits pushed by the release workflow
19+
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release):') }}
20+
1521
steps:
1622
- name: Checkout repository
1723
uses: actions/checkout@v4
1824

1925
- name: Setup Node.js
2026
uses: actions/setup-node@v4
2127
with:
22-
node-version: 25.0.0
28+
node-version-file: .nvmrc
2329
cache: 'npm'
2430
cache-dependency-path: package-lock.json
2531

2632
- name: Install dependencies
2733
run: npm ci --prefer-offline --no-audit --no-fund
2834

35+
- name: Run format check
36+
run: npm run format:check
37+
2938
- name: Run linter
3039
run: npm run lint
3140

32-
test:
33-
name: Unit Tests
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Checkout repository
37-
uses: actions/checkout@v4
38-
39-
- name: Setup Node.js
40-
uses: actions/setup-node@v4
41-
with:
42-
node-version: 25.0.0
43-
cache: 'npm'
44-
cache-dependency-path: package-lock.json
45-
46-
- name: Install dependencies
47-
run: npm ci --prefer-offline --no-audit --no-fund
48-
4941
- name: Run tests
5042
run: npm test
5143

52-
format:
53-
name: Format Check
54-
runs-on: ubuntu-latest
55-
steps:
56-
- name: Checkout repository
57-
uses: actions/checkout@v4
58-
59-
- name: Setup Node.js
60-
uses: actions/setup-node@v4
61-
with:
62-
node-version: 25.0.0
63-
cache: 'npm'
64-
cache-dependency-path: package-lock.json
65-
66-
- name: Install dependencies
67-
run: npm ci --prefer-offline --no-audit --no-fund
68-
69-
- name: Run format check
70-
run: npm run format:check
71-
7244
build:
73-
name: Build (gated)
45+
name: Build
7446
runs-on: ubuntu-latest
75-
needs: [lint, format, test]
76-
if: github.event_name == 'pull_request'
47+
needs: [check]
7748
steps:
7849
- name: Checkout repository
7950
uses: actions/checkout@v4
8051

8152
- name: Setup Node.js
8253
uses: actions/setup-node@v4
8354
with:
84-
node-version: 25.0.0
55+
node-version-file: .nvmrc
8556
cache: 'npm'
8657
cache-dependency-path: package-lock.json
8758

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ['v[0-9]*']
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
name: Publish
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .nvmrc
25+
cache: 'npm'
26+
cache-dependency-path: package-lock.json
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install dependencies
30+
run: npm ci --prefer-offline --no-audit --no-fund
31+
32+
- name: Build
33+
run: npm run build:only
34+
35+
- name: Publish to npm
36+
run: npm publish --provenance --access public
37+
38+
- name: Install git-cliff
39+
uses: kenji-miyake/setup-git-cliff@v2
40+
41+
- name: Generate release notes
42+
run: git-cliff --latest --strip header > RELEASE_NOTES.md
43+
44+
- name: Create GitHub Release
45+
run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes-file RELEASE_NOTES.md
46+
env:
47+
GH_TOKEN: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
15+
# Skip release commits to avoid infinite loops
16+
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release):') }}
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Install git-cliff
25+
uses: kenji-miyake/setup-git-cliff@v2
26+
27+
- name: Determine next version
28+
id: version
29+
run: |
30+
NEXT=$(git-cliff --bumped-version 2>/dev/null)
31+
CURRENT=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
32+
if [ "$NEXT" = "$CURRENT" ]; then
33+
echo "No version bump needed"
34+
echo "bump=false" >> "$GITHUB_OUTPUT"
35+
else
36+
echo "Next version: $NEXT"
37+
echo "bump=true" >> "$GITHUB_OUTPUT"
38+
echo "version=$NEXT" >> "$GITHUB_OUTPUT"
39+
fi
40+
41+
- name: Setup Node.js
42+
if: steps.version.outputs.bump == 'true'
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version-file: .nvmrc
46+
47+
- name: Bump package.json version
48+
if: steps.version.outputs.bump == 'true'
49+
run: npm version "${{ steps.version.outputs.version }}" --no-git-tag-version
50+
51+
- name: Generate changelog
52+
if: steps.version.outputs.bump == 'true'
53+
run: git-cliff --tag "${{ steps.version.outputs.version }}" -o CHANGELOG.md
54+
55+
- name: Commit and tag
56+
if: steps.version.outputs.bump == 'true'
57+
run: |
58+
git config user.name "github-actions[bot]"
59+
git config user.email "github-actions[bot]@users.noreply.github.com"
60+
git add package.json package-lock.json CHANGELOG.md
61+
git commit -m "chore(release): ${{ steps.version.outputs.version }}"
62+
git tag "${{ steps.version.outputs.version }}"
63+
git push origin main --follow-tags

CHANGELOG.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased](https://github.com/StudioLambda/Query/compare/v1.4.0...HEAD)
6+
7+
### Bug Fixes
8+
9+
- Remove unecesary dependency ([fbfda60](https://github.com/StudioLambda/Query/commit/fbfda607291bb8a87cc35423f3ff8ad524d8fcb7))
10+
- Upgrade node version ([82a4651](https://github.com/StudioLambda/Query/commit/82a46511ddb956d14b540ab2d148db79db7e64c1))
11+
- **tests**: Revert to default reporter ([8f1f009](https://github.com/StudioLambda/Query/commit/8f1f00962208ba4b80d66ec7ee8e4ae69b477d61))
12+
- Disable no-shadow lint rule and remove dead code in query ([5cd9644](https://github.com/StudioLambda/Query/commit/5cd96441a7918a8c9e21eabe098efdc91d6f9aca))
13+
14+
### Documentation
15+
16+
- Add comprehensive JSDoc documentation to all exported APIs ([89c9388](https://github.com/StudioLambda/Query/commit/89c93883641af4d45fdc5178c73d6a4e66a3e1ef))
17+
18+
### Features
19+
20+
- Improve tests ([e35d444](https://github.com/StudioLambda/Query/commit/e35d444b0b935d7c3539f3953ee7dbf650df82a2))
21+
- Remove memos ([25da77f](https://github.com/StudioLambda/Query/commit/25da77f1197d39d4165ced3536adb19de65b1b70))
22+
- **tests**: Github actions reporter ([663d5a1](https://github.com/StudioLambda/Query/commit/663d5a1ff0cb0a423e75edb516527f7ac5922cb6))
23+
- Add agent skill and improve readonly type safety ([341a4ac](https://github.com/StudioLambda/Query/commit/341a4aca79a66215a9d98bc74d283160aa65690f))
24+
- **react**: Use useEffectEvent for effect event handlers ([c650fbb](https://github.com/StudioLambda/Query/commit/c650fbb0becf0d1c34cb93b58cf296b9de2770b2))
25+
26+
### Miscellaneous
27+
28+
- Migrate from eslint+prettier to oxlint+oxfmt ([fe975c8](https://github.com/StudioLambda/Query/commit/fe975c8cabd65f122dd7f614da86baa442456815))
29+
- Update all dev dependencies to latest versions ([ec990b9](https://github.com/StudioLambda/Query/commit/ec990b9f1ff096123558d2f479e7b8e4e77959d7))
30+
31+
### Styling
32+
33+
- Format with oxfmt ([56fecdd](https://github.com/StudioLambda/Query/commit/56fecddf6d9612d3ac9d7a14f635b2bbc4c19558))
34+
35+
## [1.4.0](https://github.com/StudioLambda/Query/compare/v1.3.0...v1.4.0) - 2025-10-26
36+
37+
### Bug Fixes
38+
39+
- Ci node version ([1b47428](https://github.com/StudioLambda/Query/commit/1b474286791d1323d9a35e1a12b700e7f0acf39c))
40+
- Type imports ([b2ee694](https://github.com/StudioLambda/Query/commit/b2ee6947f769ce5ceb24b76e0bb3b2080e1c6d04))
41+
- Only build on ci ([aaf3d51](https://github.com/StudioLambda/Query/commit/aaf3d51d7c3cee21db1124f081c5179a08d8020c))
42+
- Format check on ci ([0011a70](https://github.com/StudioLambda/Query/commit/0011a7004080b7b5356dd798d52b1f6d7662e6ff))
43+
- Typo in ci ([138144a](https://github.com/StudioLambda/Query/commit/138144abf16417282b0ce21675b90d0ecaa8fe68))
44+
- Remove wildcard from ignore dist in eslint ([1b63b51](https://github.com/StudioLambda/Query/commit/1b63b51ad71f75d91d43270d2127149d576ee8d8))
45+
- Query on provider ([0446791](https://github.com/StudioLambda/Query/commit/044679162dee159d4cc09acb46e9045a1fdc10d0))
46+
- **react**: Preserve hooks and component names and fixes to broadcast channel ([556ade5](https://github.com/StudioLambda/Query/commit/556ade5188ce54e029bfb36d2a2ff7ddc23d65af))
47+
48+
### Features
49+
50+
- Bump version to 1.3.0 ([0505a87](https://github.com/StudioLambda/Query/commit/0505a87d061c42a427836c1959784386b386fff2))
51+
- Upgrade deps + fix linting errors ([f0e2991](https://github.com/StudioLambda/Query/commit/f0e2991d5fa059bc90f90e38c6bf48071ad613a7))
52+
- **react**: React compiler ([0b09cf2](https://github.com/StudioLambda/Query/commit/0b09cf25e52b39b3b0db415b0f969f8e83224dd8))
53+
- Bump version to 1.4.0 ([038e849](https://github.com/StudioLambda/Query/commit/038e84961be09e234826fb682d928ad601f74e1a))
54+
- Add .nvmrc file ([2783b04](https://github.com/StudioLambda/Query/commit/2783b04ba52ef2ea01c46290cb9baae33f5d2995))
55+
56+
### Miscellaneous
57+
58+
- **ci**: Rename ci jobs ([38d4426](https://github.com/StudioLambda/Query/commit/38d4426b3feac1459f236263932c27f28c0b89fd))
59+
- Rename prettier config file ([2a932bf](https://github.com/StudioLambda/Query/commit/2a932bf1fde323db3965d4240dae079dfdc62afa))
60+
61+
### Chose
62+
63+
- **ci**: Only build if pr to main ([f94fb70](https://github.com/StudioLambda/Query/commit/f94fb7096685fa747afce08e6716c6f4518685bb))
64+
65+
## [1.3.0](https://github.com/StudioLambda/Query/compare/v1.2.0...v1.3.0) - 2025-09-09
66+
67+
### Bug Fixes
68+
69+
- Wrong name on test file ([c3edc44](https://github.com/StudioLambda/Query/commit/c3edc44426bd0ef75620f361dd457997dcd744b4))
70+
71+
### Features
72+
73+
- Bump deps ([0027d28](https://github.com/StudioLambda/Query/commit/0027d28d3641eda8d3a70f7632602f3046be382e))
74+
- Added devEngines ([60dc761](https://github.com/StudioLambda/Query/commit/60dc7611ffee38bcc573def9f1b63f8fba18c99c))
75+
- Upgrade deps, fixes to snapshop and more tests ([fd19ae0](https://github.com/StudioLambda/Query/commit/fd19ae04185f2a604f8a66272c9466f60e143a55))
76+
77+
## [1.2.0](https://github.com/StudioLambda/Query/compare/v1.1.1...v1.2.0) - 2025-02-22
78+
79+
### Bug Fixes
80+
81+
- **react**: Fix useQueryBasic's initial render ([aff497a](https://github.com/StudioLambda/Query/commit/aff497a8e4fbaa9630dc140da286ed6e5d6cd73d))
82+
- **react**: Export prefetch tags ([c60d1c7](https://github.com/StudioLambda/Query/commit/c60d1c748fb81f6388931100bd85be34b534af43))
83+
- **package**: Update lock ([0200ad3](https://github.com/StudioLambda/Query/commit/0200ad36a7547d038fb225f87b8d41a7ab721949))
84+
85+
### Features
86+
87+
- **react**: Prefetching + prefetch tags ([56e52f1](https://github.com/StudioLambda/Query/commit/56e52f1949b1c2e2aae286d0368bb4a590cc60ea))
88+
- **package**: Update dependencies ([108209d](https://github.com/StudioLambda/Query/commit/108209da2bf441704b0ab180fe176bb8f7bb064e))
89+
90+
## [1.1.1](https://github.com/StudioLambda/Query/compare/v1.1.0...v1.1.1) - 2025-02-15
91+
92+
### Bug Fixes
93+
94+
- **react**: Simplified initial state ([7971518](https://github.com/StudioLambda/Query/commit/7971518887c473c8f897a86d8236eb840c91cec9))
95+
96+
### Features
97+
98+
- **react**: Add useQueryBasic hook + update dependencies ([4ebbd59](https://github.com/StudioLambda/Query/commit/4ebbd595298254753f97c1379c899f3510920a0e))
99+
- **package**: Update package version ([6dfef0c](https://github.com/StudioLambda/Query/commit/6dfef0cf2542c1956d0f0b44f2e8c17fb3e36070))
100+
101+
## [1.1.0](https://github.com/StudioLambda/Query/compare/v1.0.0...v1.1.0) - 2025-01-27
102+
103+
### Bug Fixes
104+
105+
- **query,react**: Fixes to implementation ([8da1972](https://github.com/StudioLambda/Query/commit/8da1972c172dc49da4e232ced160022e6ad21efb))
106+
- **tests**: Remove ts expect err ([c936997](https://github.com/StudioLambda/Query/commit/c93699719236619951649e1537f799ccadd63316))
107+
- **tests**: React global act ([fd185a3](https://github.com/StudioLambda/Query/commit/fd185a38076a269514223feb48f83e29b0d2152c))
108+
109+
### Features
110+
111+
- **query**: Separate types ([5fb48de](https://github.com/StudioLambda/Query/commit/5fb48ded5ef362f4a9438749c62548e71ba5cb92))
112+
- **ci**: Add ci for tests ([f963136](https://github.com/StudioLambda/Query/commit/f963136f616f601a9b14178b26ea99ded4c75a3a))
113+
114+
## [1.0.0](https://github.com/StudioLambda/Query/compare/...v1.0.0) - 2025-01-04
115+
116+
### Bug Fixes
117+
118+
- **core**: Types ([f4c4c54](https://github.com/StudioLambda/Query/commit/f4c4c54ec8014754fb4b0ab9b83d261ba53acf8e))
119+
- **query**: Default generic type ([b33bf68](https://github.com/StudioLambda/Query/commit/b33bf680b0ef7241b4b308f864016285cc5b0568))
120+
121+
### Features
122+
123+
- Update bundling ([c0a3a0b](https://github.com/StudioLambda/Query/commit/c0a3a0b169ed6462f56678d2a287d5700d124daa))
124+
- New release ([35bd927](https://github.com/StudioLambda/Query/commit/35bd92756e385163f1767938c33079ae3e621062))
125+
- Snapshot ([8333fed](https://github.com/StudioLambda/Query/commit/8333fed568c1d7706991e7519c0ac14ca0f30602))
126+
- Caches + events ([91cb43d](https://github.com/StudioLambda/Query/commit/91cb43db219aff8b8819de0012000b2df81d17aa))
127+
- **core**: Refactor to lambda query ([82582ea](https://github.com/StudioLambda/Query/commit/82582ea420acdf732c096180b5785e46acb025a4))
128+
- **core**: Add keywords ([4974ecb](https://github.com/StudioLambda/Query/commit/4974ecb7b9caa6d9783e6c9ad541466ecf5b4160))
129+
130+
### Miscellaneous
131+
132+
- Update spelling and fix typos ([b514a32](https://github.com/StudioLambda/Query/commit/b514a32abcd29318a8c5aa10731ee7ec8b339dfd))
133+
134+

0 commit comments

Comments
 (0)