Skip to content

Commit a3f230c

Browse files
committed
ci: add tag-based release automation with git-cliff
Add GitHub Actions CI workflow for push and pull_request validation using JDK 21 and ./gradlew test. Add tag-triggered release workflow for v* tags that builds/tests artifacts and publishes GitHub Releases. Use git-cliff (cliff.toml) to generate release notes from commits between tags and publish them as release body. Update README, STATUS, DONE, and ROADMAP with CI/CD and release-note automation details. Update AGENTS.md with strict commit-prefix and one-commit-per-fix collaboration rules for cliff-compatible history.
1 parent 5f434da commit a3f230c

8 files changed

Lines changed: 163 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ci-${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build-and-test:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up JDK 21
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: temurin
31+
java-version: "21"
32+
33+
- name: Set up Gradle
34+
uses: gradle/actions/setup-gradle@v4
35+
36+
- name: Fetch tags for jgitver
37+
run: git fetch --force --tags
38+
39+
- name: Run unit tests
40+
run: ./gradlew --no-daemon test

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up JDK 21
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: "21"
25+
26+
- name: Set up Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
29+
- name: Fetch tags for jgitver
30+
run: git fetch --force --tags
31+
32+
- name: Build and test
33+
run: ./gradlew --no-daemon clean test distZip distTar
34+
35+
- name: Generate release notes (git-cliff)
36+
id: git-cliff
37+
uses: orhun/git-cliff-action@v4
38+
with:
39+
config: cliff.toml
40+
args: --latest --strip header
41+
env:
42+
OUTPUT: RELEASE_NOTES.md
43+
44+
- name: Publish GitHub Release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
name: SnapFX ${{ github.ref_name }}
48+
tag_name: ${{ github.ref_name }}
49+
body_path: RELEASE_NOTES.md
50+
fail_on_unmatched_files: true
51+
prerelease: ${{ contains(github.ref_name, '-') }}
52+
files: |
53+
build/distributions/*.zip
54+
build/distributions/*.tar
55+
build/libs/*.jar

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ These instructions are shared for all AI agents working on this workspace.
1212
- Always `git add` new files when preparing a commit.
1313
- Before creating a commit, always show the proposed commit message to the user and get confirmation.
1414
- Keep commits minimally mixed: one logical topic/fix per commit; avoid bundling unrelated changes.
15+
- Default to one commit per fix/feature so changes stay clearly separated and release notes remain precise.
1516
- For fix commits, use a multi-line commit message body with at least one explanation line per fix.
17+
- Use git-cliff-compatible commit prefixes in the subject line (`feat:`, `fix:`, `docs:`, `test:`, `refactor:`, `perf:`, `ci:`, `build:`, `chore:`); domain prefixes like `floating:`, `dnd:`, `ui:`, `demo:` are also allowed when they map to cliff groups.
1618
- If a fixed collaboration rule is agreed with the user, add it to this `AGENTS.md` immediately.
1719
- Treat `AGENTS.md` as the source of truth for all persistent collaboration rules in this workspace.
1820
- As soon as a focused, sensible commit is ready, proactively show the proposed commit message without waiting for the user to ask.

DONE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ SnapFX has been fully implemented with core functionality and is production-read
209209
### Build & Deployment
210210
- ✅ Completed `runSimpleExample` Gradle task for launching `SimpleExample` with JavaFX module runtime support.
211211
-`SimpleExample` now logs a warning through `System.Logger` when `snapfx.css` is missing, without requiring a logging framework dependency.
212+
- ✅ Added GitHub Actions CI workflow for push/PR validation with `./gradlew test` on JDK 21.
213+
- ✅ Added GitHub Actions release workflow for `v*` tags that runs build/tests and publishes GitHub Releases with distribution artifacts.
214+
- ✅ Added `git-cliff` release-note generation (`cliff.toml`) and wired release workflow to publish generated notes.
212215
-**Gradle Build**: Modern Kotlin DSL build script
213216
-**Module Configuration**: Java 21 module support
214217
-**JavaFX Integration**: JavaFX Gradle plugin

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,21 @@ Optional push:
294294
- Later phase: move integration to `develop`, keep `main` release-focused
295295
- Release flow after `develop` is introduced: merge `develop` -> `main`, then create/push release tag (`vX.Y.Z`)
296296

297+
## CI/CD
298+
299+
- GitHub Actions CI (`.github/workflows/ci.yml`) runs on every push and pull request
300+
- CI executes `./gradlew test` on JDK 21
301+
- GitHub Release workflow (`.github/workflows/release.yml`) runs only when a tag matching `v*` is pushed
302+
- Release workflow executes `./gradlew clean test distZip distTar` and publishes a GitHub Release with build artifacts
303+
- Release notes are generated by `git-cliff` (`cliff.toml`) and attached as the release body
304+
305+
### Release Notes (git-cliff)
306+
307+
- Config file: `cliff.toml`
308+
- Notes are generated from commits between tags
309+
- Prefix-based grouping is enabled (for example `feat:`, `fix:`, `docs:`, `ci:`, `floating:`)
310+
- Tag push flow: `git push origin main --tags`
311+
297312
## License
298313

299314
This project is a demo framework for educational purposes.

ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,12 @@ This roadmap lists planned work only; fixed issues are tracked in `STATUS.md`.
342342
### 8.1 Packaging & Distribution
343343
**Priority**: 🟡 High
344344

345+
-**GitHub tag release workflow**: Pushing `v*` tags now runs build/test and publishes a GitHub Release with distribution artifacts
346+
-**Release notes automation**: `git-cliff` now generates tag-based release notes used as GitHub Release body
345347
- 📋 **Maven Central**: Publish to Maven Central
346348
- 📋 **jlink support**: Create custom runtime images
347349
- 📋 **jpackage support**: Native installers
348350
- 📋 **Version management**: Semantic versioning
349-
- 📋 **Release notes**: Automated changelog
350351

351352
**Estimated Time**: 2-3 days
352353

STATUS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
**Build**: `BUILD SUCCESSFUL`
88
**Tests**: All 155 tests passing (latest full suite)
99
**Module System**: Fully implemented (JPMS)
10-
**Demo App**: Running successfully
10+
**Demo App**: Running successfully
11+
**CI Automation**: GitHub Actions workflows added for push/PR tests and tag-triggered releases
12+
**Release Notes Automation**: `git-cliff` generates tag-based GitHub Release notes
1113

1214
## Implementation Progress
1315

@@ -177,6 +179,9 @@
177179
- ✅ 2026-02-15: Floating Window - Drag & drop visual feedback is now shown inside floating windows
178180
- ✅ 2026-02-15: Floating Window - Pin button behavior is now configurable (`ALWAYS`/`AUTO`/`NEVER`) with default pinned state, lock-mode policy, and optional user-toggle disable.
179181
- ✅ 2026-02-15: Persistence - Floating window always-on-top state is now serialized/restored and exposed through source-aware pin change callbacks.
182+
- ✅ 2026-02-15: CI - Added GitHub Actions workflow for push/PR validation (`./gradlew test`) with tag fetch for `gradle-jgitver`.
183+
- ✅ 2026-02-15: Release - Added tag-triggered GitHub Release workflow for `v*` tags that builds/tests and publishes distribution artifacts.
184+
- ✅ 2026-02-15: Release - Integrated `git-cliff` (`cliff.toml`) to generate grouped release notes from commits between tags.
180185
- ✅ 2026-02-15: Floating Window - Double-click on maximized title bar now restores previous window bounds
181186
- ✅ 2026-02-15: Floating Window - Dragging a maximized title bar now restores and continues move (Windows-style behavior)
182187
- ✅ 2026-02-15: UI - Tab float button clicks are no longer intercepted by drag handling
@@ -220,6 +225,8 @@
220225
- Added SnapFX SVG logo to README for shared GitHub/GitHub Pages branding usage.
221226
- Added roadmap item for a full GitHub Pages documentation portal.
222227
- Updated `AGENTS.md` collaboration rules: fix commits require per-fix explanation lines and multi-statement UI callbacks must be extracted to named methods.
228+
- Added CI/CD documentation for GitHub Actions push/PR checks and tag-based release publishing.
229+
- Added `git-cliff` release-notes documentation and repository configuration (`cliff.toml`).
223230

224231
### UI Styling
225232
- Removed `DockControlIcons` vector icon usage from dock/floating controls and switched to stylesheet-driven glyph classes.

cliff.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[changelog]
2+
header = """
3+
# Changelog
4+
5+
All notable changes to this project are documented in this file.
6+
"""
7+
8+
body = """
9+
{% if version %}
10+
## {{ version }} - {{ timestamp | date(format="%Y-%m-%d") }}
11+
{% else %}
12+
## Unreleased
13+
{% endif %}
14+
{% for group, commits in commits | group_by(attribute="group") %}
15+
### {{ group | striptags | trim }}
16+
{% for commit in commits %}
17+
- {{ commit.message | split(pat="\n") | first | trim }} ({{ commit.id | truncate(length=7, end="") }})
18+
{% endfor %}
19+
{% endfor %}
20+
"""
21+
22+
trim = true
23+
24+
[git]
25+
tag_pattern = "v[0-9].*"
26+
filter_unconventional = false
27+
sort_commits = "newest"
28+
29+
commit_parsers = [
30+
{ message = "^(feat|feature)(\\(.+\\))?:", group = "Features" },
31+
{ message = "^(fix|bugfix|hotfix)(\\(.+\\))?:", group = "Fixes" },
32+
{ message = "^(floating|dnd|ui|demo)(\\(.+\\))?:", group = "UI and Interaction" },
33+
{ message = "^(perf|refactor)(\\(.+\\))?:", group = "Refactoring" },
34+
{ message = "^(test|tests)(\\(.+\\))?:", group = "Tests" },
35+
{ message = "^(docs|doc)(\\(.+\\))?:", group = "Documentation" },
36+
{ message = "^(build|ci|chore)(\\(.+\\))?:", group = "Build and Tooling" },
37+
{ message = "^[a-zA-Z0-9_-]+(\\(.+\\))?:", group = "Other Changes" },
38+
]

0 commit comments

Comments
 (0)