Skip to content

Commit be133fe

Browse files
grdsdevclaude
andauthored
feat: migrate from release-please to semantic-release (#748)
* feat: migrate from release-please to semantic-release - Add semantic-release configuration and workflow - Support for release candidates via rc branch - Remove old release-please configuration files - Add Node.js dependencies to .gitignore - Update version management script 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: rename semantic-release workflow to release - Update workflow name from "Semantic Release" to "Release" - Update documentation to reflect new workflow filename 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8ac8c4a commit be133fe

File tree

9 files changed

+7074
-29
lines changed

9 files changed

+7074
-29
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
1+
name: Release
2+
13
on:
24
push:
35
branches:
46
- main
5-
- release/*
6-
7-
permissions:
8-
contents: write
9-
pull-requests: write
10-
11-
name: release-please
7+
- rc
8+
workflow_dispatch:
129

1310
jobs:
14-
release-please:
11+
release:
1512
runs-on: ubuntu-latest
13+
if: "!contains(github.event.head_commit.message, 'skip ci')"
14+
1615
steps:
17-
- uses: googleapis/release-please-action@v4
16+
- name: Checkout
17+
uses: actions/checkout@v4
1818
with:
19-
target-branch: ${{ github.ref_name }}
19+
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run semantic-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: npx semantic-release

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,10 @@ Secrets.swift
102102
lcov.info
103103
temp_coverage
104104

105-
.cursor
105+
.cursor
106+
107+
# Node.js
108+
node_modules/
109+
npm-debug.log*
110+
yarn-debug.log*
111+
yarn-error.log*

.releaserc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "rc",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
[
12+
"@semantic-release/changelog",
13+
{
14+
"changelogFile": "CHANGELOG.md"
15+
}
16+
],
17+
[
18+
"@semantic-release/exec",
19+
{
20+
"prepareCmd": "scripts/update-version.sh ${nextRelease.version}"
21+
}
22+
],
23+
[
24+
"@semantic-release/git",
25+
{
26+
"assets": ["CHANGELOG.md", "Sources/Helpers/Version.swift"],
27+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
28+
}
29+
],
30+
[
31+
"@semantic-release/github",
32+
{
33+
"assets": []
34+
}
35+
]
36+
]
37+
}

RELEASE.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Semantic Release Setup
2+
3+
This project uses [semantic-release](https://semantic-release.gitbook.io/) to automate version management and package publishing.
4+
5+
## How it works
6+
7+
1. **Commit messages** follow the [Conventional Commits](https://www.conventionalcommits.org/) specification
8+
2. **Semantic-release** analyzes commits and determines the next version number
9+
3. **GitHub Actions** automatically creates releases when changes are pushed to `main`
10+
11+
## Commit Message Format
12+
13+
```
14+
<type>[optional scope]: <description>
15+
16+
[optional body]
17+
18+
[optional footer(s)]
19+
```
20+
21+
### Types
22+
23+
- `feat`: A new feature (triggers minor version bump)
24+
- `fix`: A bug fix (triggers patch version bump)
25+
- `docs`: Documentation only changes
26+
- `style`: Changes that do not affect the meaning of the code
27+
- `refactor`: A code change that neither fixes a bug nor adds a feature
28+
- `perf`: A code change that improves performance
29+
- `test`: Adding missing tests or correcting existing tests
30+
- `chore`: Changes to the build process or auxiliary tools
31+
32+
### Breaking Changes
33+
34+
Add `BREAKING CHANGE:` in the footer or use `!` after the type to trigger a major version bump:
35+
36+
```
37+
feat!: remove deprecated API
38+
```
39+
40+
or
41+
42+
```
43+
feat: add new feature
44+
45+
BREAKING CHANGE: This removes the old API
46+
```
47+
48+
## Release Process
49+
50+
### Regular Releases (main branch)
51+
52+
1. Push commits to `main` branch
53+
2. GitHub Actions runs semantic-release
54+
3. If there are releasable changes:
55+
- Version is updated in `Sources/Helpers/Version.swift`
56+
- `CHANGELOG.md` is updated
57+
- Git tag is created
58+
- GitHub release is published
59+
60+
### Release Candidates (rc branch)
61+
62+
1. Push commits to `rc` branch
63+
2. GitHub Actions runs semantic-release
64+
3. If there are releasable changes:
65+
- Prerelease version is created (e.g., `2.31.0-rc.1`)
66+
- Version is updated in `Sources/Helpers/Version.swift`
67+
- `CHANGELOG.md` is updated
68+
- Git tag is created
69+
- GitHub prerelease is published
70+
71+
## Manual Release
72+
73+
To manually trigger a release:
74+
75+
1. Go to Actions tab in GitHub
76+
2. Select "Semantic Release" workflow
77+
3. Click "Run workflow"
78+
79+
## Configuration Files
80+
81+
- `.releaserc.json`: Semantic-release configuration
82+
- `package.json`: Node.js dependencies
83+
- `.github/workflows/release.yml`: GitHub Actions workflow
84+
- `scripts/update-version.sh`: Version update script

Sources/Helpers/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import XCTestDynamicOverlay
33

4-
private let _version = "2.30.2" // {x-release-please-version}
4+
private let _version = "2.30.2"
55

66
#if DEBUG
77
package let version = isTesting ? "0.0.0" : _version

0 commit comments

Comments
 (0)