Skip to content

Commit 6735778

Browse files
committed
chore: automatic semantic versioning with nyx
1 parent 9ed3052 commit 6735778

8 files changed

Lines changed: 222 additions & 56 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
pull_request: # Run on pull requests
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
22+
- name: Set up Gradle
23+
uses: gradle/actions/setup-gradle@v4
24+
25+
- name: Run tests
26+
run: ./gradlew test
27+
28+
- name: Build extension
29+
run: ./gradlew bwextension
30+
31+
- name: Upload extension artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: WigAI.bwextension-pr-${{ github.event.number || github.sha }}
35+
path: build/extensions/WigAI.bwextension
36+
retention-days: 7

.github/workflows/release.yml

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
name: Release Extension
22

33
on:
4-
workflow_dispatch: # Allows manual triggering
5-
pull_request: # Run on pull requests
6-
# push:
7-
# branches:
8-
# - main # Triggers on pushes to the main branch
4+
push:
5+
branches: [main] # Automatic releases on main branch
6+
workflow_dispatch: # Manual triggering
97

108
permissions:
119
contents: write
10+
issues: write
11+
pull-requests: write
12+
actions: write
13+
packages: write
1214

1315
jobs:
14-
build:
16+
release:
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Checkout code
1820
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # Fetch full history for Nyx
23+
token: ${{ secrets.GITHUB_TOKEN }}
1924

2025
- name: Set up JDK 21
2126
uses: actions/setup-java@v4
@@ -26,53 +31,19 @@ jobs:
2631
- name: Set up Gradle
2732
uses: gradle/actions/setup-gradle@v4
2833

29-
- name: Build extension
30-
run: ./gradlew bwextension
34+
- name: Run tests
35+
run: ./gradlew test
3136

32-
- name: Upload extension artifact
33-
uses: actions/upload-artifact@v4
34-
with:
35-
name: WigAI.bwextension
36-
path: build/extensions/WigAI.bwextension
37+
- name: Configure Git
38+
run: |
39+
git config --global user.name "github-actions[bot]"
40+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
41+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
3742
38-
release:
39-
runs-on: ubuntu-latest
40-
needs: build
41-
if: github.event_name == 'workflow_dispatch'
42-
# || (github.event_name == 'push' && github.ref == 'refs/heads/main')
43-
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v4
46-
with:
47-
fetch-depth: 0 # Fetch all history for changelog generation
48-
49-
- name: Download extension artifact
50-
uses: actions/download-artifact@v4
51-
with:
52-
name: WigAI.bwextension
53-
path: . # Download directly into the current workspace directory
54-
55-
- name: Set up Node.js
56-
uses: actions/setup-node@v4
57-
with:
58-
node-version: 'lts/*'
59-
60-
- name: Install conventional-changelog-cli
61-
run: npm install -g conventional-changelog-cli conventional-commits-parser
62-
63-
- name: Generate release notes
64-
run: conventional-changelog -p angular -i CHANGELOG.md -s -r 0 > RELEASE_NOTES.md && cat RELEASE_NOTES.md
65-
66-
- name: Generate tag name
67-
id: generate_tag # id is not strictly needed here as we are using GITHUB_ENV but good practice
68-
run: echo "TAG_NAME=release-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
43+
- name: Build extension with updated version
44+
run: ./gradlew bwextension
6945

70-
- name: Create GitHub Release
71-
uses: softprops/action-gh-release@v1
72-
with:
73-
tag_name: ${{ env.TAG_NAME }}
74-
name: Release ${{ env.TAG_NAME }}
75-
body_path: RELEASE_NOTES.md
76-
files: WigAI.bwextension # Updated path
46+
- name: Nyx publish release with assets
47+
run: ./gradlew nyxPublish
7748
env:
7849
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ hs_err_pid*
3434

3535
# Logs
3636
*.log
37+
38+
# Nyx
39+
.nyx/
40+
41+
CHANGELOG.md

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ Once the extension is activated in Bitwig Studio, the MCP server will be availab
4343

4444
This project is developed using the [BMAD v2 method](https://github.com/bmadcode/BMAD-METHOD) with AI Agents. The files in folders `agents`, `ai` and `docs` used for this development method.
4545

46+
## Releases
47+
48+
This project uses [Nyx](https://github.com/mooltiverse/nyx) for semantic versioning and automated releases. The release process follows [Conventional Commits](https://www.conventionalcommits.org/) specification:
49+
50+
- `feat:` - new features (minor version bump)
51+
- `fix:` - bug fixes (patch version bump)
52+
- `feat!:` or `BREAKING CHANGE:` - breaking changes (major version bump)
53+
- `chore:`, `docs:`, `style:`, `refactor:`, `test:` - no version bump
54+
55+
Releases are automatically created on pushes to the `main` branch when commits follow the conventional commit format.
56+
4657
## License
4758

4859
[MIT License](LICENSE)

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "io.github.fabb"
11-
version = "0.2.0"
11+
// Version is managed by Nyx - it will be set automatically by the Nyx plugin
1212

1313
repositories {
1414
mavenCentral()

docs/semantic-versioning-guide.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Semantic Versioning Guide for WigAI
2+
3+
This project uses [Semantic Versioning](https://semver.org/) with automated releases based on conventional commits.
4+
5+
## Commit Message Format
6+
7+
Use the [Conventional Commits](https://conventionalcommits.org/) specification:
8+
9+
```
10+
<type>[optional scope]: <description>
11+
12+
[optional body]
13+
14+
[optional footer(s)]
15+
```
16+
17+
## Commit Types and Version Impact
18+
19+
### PATCH Releases (0.2.0 → 0.2.1)
20+
Bug fixes that don't break existing functionality:
21+
22+
```bash
23+
git commit -m "fix: resolve null pointer exception in device controller"
24+
git commit -m "fix(mcp): handle connection timeout gracefully"
25+
git commit -m "fix(transport): correct play/pause state synchronization"
26+
```
27+
28+
### MINOR Releases (0.2.0 → 0.3.0)
29+
New features that are backward compatible:
30+
31+
```bash
32+
git commit -m "feat: add support for scene banking operations"
33+
git commit -m "feat(mcp): implement new device parameter tool"
34+
git commit -m "feat(ui): add configuration panel for MCP settings"
35+
```
36+
37+
### MAJOR Releases (0.2.0 → 1.0.0)
38+
Breaking changes that require user intervention:
39+
40+
```bash
41+
git commit -m "feat!: redesign MCP tool interface for better performance"
42+
43+
# Or with explicit breaking change footer:
44+
git commit -m "feat: change device API structure
45+
46+
BREAKING CHANGE: Device.getParameter() now returns Optional<Parameter> instead of Parameter"
47+
```
48+
49+
## Common Commit Types
50+
51+
- `fix:` - Bug fixes
52+
- `feat:` - New features
53+
- `docs:` - Documentation changes
54+
- `style:` - Code style changes (formatting, etc.)
55+
- `refactor:` - Code refactoring without feature changes
56+
- `test:` - Adding or updating tests
57+
- `chore:` - Maintenance tasks, dependency updates
58+
- `perf:` - Performance improvements
59+
- `ci:` - CI/CD configuration changes
60+
61+
## Scopes (Optional)
62+
63+
Use scopes to indicate the area of change:
64+
65+
- `mcp` - MCP server related changes
66+
- `transport` - Transport control functionality
67+
- `device` - Device parameter management
68+
- `clip` - Clip and scene management
69+
- `config` - Configuration management
70+
- `ui` - User interface changes
71+
- `api` - API changes
72+
73+
## Examples for WigAI
74+
75+
```bash
76+
# Bug fixes (PATCH)
77+
git commit -m "fix(mcp): resolve server startup race condition"
78+
git commit -m "fix(device): handle missing parameter gracefully"
79+
80+
# New features (MINOR)
81+
git commit -m "feat(transport): add support for tempo changes"
82+
git commit -m "feat(mcp): implement clip launch tool"
83+
84+
# Breaking changes (MAJOR)
85+
git commit -m "feat(api)!: change MCP tool response format"
86+
git commit -m "feat: restructure extension initialization
87+
88+
BREAKING CHANGE: WigAIExtension constructor now requires McpServerManager parameter"
89+
```
90+
91+
## Release Process
92+
93+
1. **Push to main branch** - Triggers automatic analysis
94+
2. **Semantic Release analyzes commits** - Determines version bump type
95+
3. **Version update** - Updates `build.gradle.kts` automatically
96+
4. **Changelog generation** - Updates `CHANGELOG.md`
97+
5. **GitHub release** - Creates release with artifacts
98+
6. **Git tag** - Tags the release (e.g., `v0.3.0`)
99+
100+
## No Release Scenarios
101+
102+
These commit types will NOT trigger a release:
103+
104+
```bash
105+
git commit -m "docs: update README with new features"
106+
git commit -m "style: fix code formatting"
107+
git commit -m "ci: update GitHub Actions workflow"
108+
git commit -m "chore: update dependencies"
109+
```
110+
111+
## Manual Release
112+
113+
If needed, you can manually trigger a release using GitHub Actions workflow dispatch, but it's recommended to use the commit-based approach for consistency.

settings.gradle.kts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1+
plugins {
2+
id("com.mooltiverse.oss.nyx") version "3.1.3"
3+
}
4+
15
rootProject.name = "wigai"
6+
7+
// Nyx configuration for semantic versioning and releases
8+
configure<com.mooltiverse.oss.nyx.gradle.NyxExtension> {
9+
preset.set("extended")
10+
11+
services {
12+
register("github") {
13+
type.set("GITHUB")
14+
options.set(mapOf(
15+
"AUTHENTICATION_TOKEN" to "{{#environmentVariable}}GITHUB_TOKEN{{/environmentVariable}}",
16+
"REPOSITORY_OWNER" to "fabb",
17+
"REPOSITORY_NAME" to "WigAI",
18+
))
19+
}
20+
}
21+
22+
releaseTypes {
23+
publicationServices.set(listOf("github"))
24+
}
25+
26+
// Release assets to upload
27+
releaseAssets {
28+
register("wigaiExtension") {
29+
fileName.set("WigAI.bwextension")
30+
description.set("WigAI Bitwig Extension for version {{version}}")
31+
type.set("application/java-archive")
32+
path.set("build/extensions/WigAI.bwextension")
33+
}
34+
}
35+
}

src/main/resources/META-INF/MANIFEST.MF

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)