Skip to content

Commit 2d8dacb

Browse files
gjtorikianclaude
andauthored
ci: add release-please for automated releases (#73)
* ci: add release-please for automated releases Add a release-please workflow to automate versioning, changelog generation, and npm publishing on merge to main, mirroring the setup in authkit-tanstack-start (#64). - Add release-please-config.json and .release-please-manifest.json (seeded at the current v0.11.0) - Update release.yml to use the workflow_call trigger (invoked by release-please) instead of release: [published], and collapse the prerelease/release publish steps into a single publish step Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: lint PR titles with conventional commits Add a Lint PR Title workflow using action-semantic-pull-request so PR titles follow the Conventional Commits format that release-please relies on for versioning and changelog generation. Mirrors authkit-nextjs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Bump version from 0.11.0 to 0.12.0 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a973c6a commit 2d8dacb

5 files changed

Lines changed: 68 additions & 10 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint PR Title
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
steps:
19+
- name: Generate token
20+
id: generate-token
21+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
22+
with:
23+
app-id: ${{ vars.SDK_BOT_APP_ID }}
24+
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
25+
26+
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4
27+
id: release
28+
with:
29+
token: ${{ steps.generate-token.outputs.token }}
30+
31+
publish:
32+
needs: release-please
33+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
34+
uses: ./.github/workflows/release.yml

.github/workflows/release.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ name: Release
33
on:
44
# Support manually pushing a new release
55
workflow_dispatch: {}
6-
# Trigger when a release is published
7-
release:
8-
types: [published]
6+
# Invoked by the release-please workflow when a release is created
7+
workflow_call: {}
98

109
defaults:
1110
run:
@@ -35,12 +34,6 @@ jobs:
3534
run: |
3635
npm run build
3736
38-
- name: Push Release
39-
if: ${{ !github.event.release.prerelease }}
37+
- name: Publish
4038
run: |
4139
npm publish --tag latest --access=public --provenance
42-
43-
- name: Push Pre-Release
44-
if: ${{ github.event.release.prerelease }}
45-
run: |
46-
npm publish --tag next --access=public --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.12.0"
3+
}

release-please-config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"include-component-in-tag": false,
4+
"packages": {
5+
".": {
6+
"release-type": "node",
7+
"changelog-path": "CHANGELOG.md",
8+
"versioning": "default",
9+
"bump-minor-pre-major": true
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)