Skip to content

Commit 95316b8

Browse files
grdsdevclaude
andcommitted
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 <[email protected]>
1 parent 2eac629 commit 95316b8

File tree

10 files changed

+7317
-38
lines changed

10 files changed

+7317
-38
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- rc
8+
workflow_dispatch:
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
if: "!contains(github.event.head_commit.message, 'skip ci')"
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "rc",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
"@semantic-release/release-notes-generator",
12+
[
13+
"@semantic-release/changelog",
14+
{
15+
"changelogFile": "CHANGELOG.md"
16+
}
17+
],
18+
[
19+
"@semantic-release/exec",
20+
{
21+
"prepareCmd": "scripts/update-version.sh ${nextRelease.version}"
22+
}
23+
],
24+
[
25+
"@semantic-release/git",
26+
{
27+
"assets": [
28+
"CHANGELOG.md",
29+
"Sources/Helpers/Version.swift"
30+
],
31+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
32+
}
33+
],
34+
[
35+
"@semantic-release/github",
36+
{
37+
"assets": []
38+
}
39+
]
40+
]
41+
}

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/semantic-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.1" // {x-release-please-version}
4+
private let _version = "2.30.1"
55

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

0 commit comments

Comments
 (0)