Skip to content

ci(release): add release pipeline and switch versioning to git-semver#221

Merged
Zoriot merged 12 commits into
AlpsBTE:mainfrom
num0001:feat/release-pipeline-and-semver
May 23, 2026
Merged

ci(release): add release pipeline and switch versioning to git-semver#221
Zoriot merged 12 commits into
AlpsBTE:mainfrom
num0001:feat/release-pipeline-and-semver

Conversation

@num0001
Copy link
Copy Markdown
Contributor

@num0001 num0001 commented May 22, 2026

Closes #194. Partially addresses #149 (the README overhaul will follow in a separate PR).

Sets up the full release lifecycle for Plot-System and replaces the hardcoded "5.0.3"-<hash>-SNAPSHOT version expression with one derived from git tags + conventional-commit history.

New release flow

Trigger Workflow What it does
PR opened / updated build.yml (existing, unchanged) Build + test, no release side-effects
Push to main release-draft.yml (new) Compute next clean version via gradle, maintain a single editable draft release with auto-generated notes
Maintainer clicks Publish on the draft GitHub creates the tag
release: published release.yml (new) Build from the tag, attach the shaded JAR to the release

Changes

Versioning

  • gradle/libs.versions.toml: swap palantir/gradle-git-version (5.0.0) for jmongard/git-semver-plugin (0.19.0).
  • build.gradle.kts: replace hardcoded version with semver.semVersion. Adds a printNextReleaseVersion helper task that returns the next clean version (stripped of the -SNAPSHOT suffix the plugin adds between tags). The task captures its value at configuration time so it stays compatible with the project's configuration cache.

Draft release maintenance (new)

  • .github/workflows/release-draft.yml: runs on push to main. Calls ./gradlew -q printNextReleaseVersion and feeds the result to release-drafter/release-drafter@v6.
  • .github/release-drafter.yml: minimal config with three categories (Features, Bug Fixes, Maintenance) mapped to existing repo labels (enhancement, bug, dependencies, documentation). PRs without a matching label fall under the uncategorised list.

Release artifact upload (new)

  • .github/workflows/release.yml: runs on release: published, checks out the release tag, builds, and attaches build/libs/*.jar via softprops/action-gh-release@v2. Uses the default GITHUB_TOKEN with contents: write — no extra secrets required.

Commit convention going forward

With the new semver plugin active, conventional-commit prefixes drive the next version bump:

Prefix Effect
feat: … minor bump (5.0.2 → 5.1.0)
fix: … patch bump (5.0.2 → 5.0.3)
feat!: or footer BREAKING CHANGE: major bump
build: / ci: / chore: / docs: / refactor: / test: no bump

This PR's commits use build(gradle): and ci(release): so merging it does not bump the version on its own.

Caveats / notes

  • Manual edits to the draft body are overwritten on the next push to main (release-drafter regenerates the "What's Changed" section each run). Intended workflow: pause merging → polish the draft → publish. Splitting the body into auto/manual regions is doable as a follow-up if needed.
  • No "New Contributors" section. release-drafter doesn't expose first-time contributors, and GitHub's native auto-generated notes (which do include that block) don't fit a maintained-draft workflow. Could be added later via an extra step that calls gh api .../releases/generate-notes and appends just that section.

Out of scope (intentionally deferred)

Test plan

  • ./gradlew clean build passes locally with the new plugin.
  • ./gradlew -q printNextReleaseVersion returns the clean version (no -SNAPSHOT) and is configuration-cache compatible.
  • After merge, release-draft.yml produces a draft visible on the Releases page.
  • Clicking Publish on the draft triggers release.yml and the resulting release has PlotSystem-<version>.jar attached.

amrdoh and others added 9 commits May 22, 2026 01:52
…d/git-semver

Replaces the hardcoded `"5.0.3" + gitHash + "-SNAPSHOT"` expression
with `version = semver.semVersion`. The project version is now
derived from the latest vMAJOR.MINOR.PATCH tag plus the
conventional-commit messages since that tag, so release builds
produce clean version numbers (e.g. PlotSystem-5.0.3.jar) without
manual edits to build.gradle.kts before each release.

Also adds a `printNextReleaseVersion` helper task used by the
release-draft workflow. The plugin's `printVersion` task includes
a `-SNAPSHOT` suffix on commits between releases, which is correct
for the JAR version but wrong for the draft release tag — the
helper strips the suffix so the draft tag is e.g. `v5.0.3` instead
of `v5.0.3-SNAPSHOT`. The value is computed at task-configuration
time so the task stays compatible with the project's configuration
cache.
Adds release-draft.yml plus the release-drafter config. On each
push to main the workflow runs `./gradlew -q printNextReleaseVersion`
to compute the next clean release version, then hands it to
release-drafter/release-drafter@v6, which keeps a single draft
release in sync — updating the "What's Changed" section and
bumping the tag if the computed version changes. The draft is
editable; the maintainer publishes it manually when ready.

Categorisation in the draft uses three sections (Features, Bug
Fixes, Maintenance) mapped to the labels already in use on this
repo (enhancement, bug, dependencies, documentation). PRs without
a matching label fall under the uncategorised list.
@Cinnazeyy
Copy link
Copy Markdown
Member

Hey, thanks for tackling this issue!
Since these changes will affect every contributor, I think it would be great to have an overview of how contributors are expected to name commits in the Contributing section of the projects Readme file. Later on we might add a CONTRIBUTING.md file, but i think for now, adding the info into the readme would be sufficient.
Please also include the case of when no recognised prefix is provided.

Comment thread .github/release-drafter.yml
Comment thread .github/workflows/release-draft.yml
@Cinnazeyy
Copy link
Copy Markdown
Member

Make sure to pull the latest changes from main and implement the changes requested by Zoriot from the closed PR, other than that LGTM. Ill approve once done.

@num0001
Copy link
Copy Markdown
Contributor Author

num0001 commented May 23, 2026

Make sure to pull the latest changes from main and implement the changes requested by Zoriot from the closed PR, other than that LGTM. Ill approve once done.

I already fix all requests, plz check it out.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a GitHub-native release lifecycle for Plot-System and switches Gradle versioning from a hardcoded git-hash snapshot string to semver derived from git tags + conventional-commit history.

Changes:

  • Replace com.palantir.git-version with com.github.jmongard.git-semver-plugin and set project.version from the semver plugin.
  • Add a Gradle helper task (printNextReleaseVersion) to output the next “clean” release version for automation.
  • Add two new GitHub Actions workflows (release-draft.yml, release.yml) plus a release-drafter configuration to maintain a single draft release and attach built artifacts on publish.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gradle/libs.versions.toml Swaps the git-version plugin dependency for the git-semver plugin in the version catalog.
build.gradle.kts Switches version to semver.semVersion and adds printNextReleaseVersion for workflows.
.github/workflows/release.yml New workflow to build from a published release tag and upload JAR artifacts to the release.
.github/workflows/release-draft.yml New workflow to compute the next version on main and update/maintain a draft release via release-drafter.
.github/release-drafter.yml New release-drafter configuration (templates + label-based categories).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Upgrade workflow dependencies (`actions/checkout`, `gradle/actions/setup-gradle`, `softprops/action-gh-release`, `actions/upload-artifact`, and `release-drafter/release-drafter`) to their latest stable versions for improved compatibility and performance.
Copy link
Copy Markdown
Member

@Cinnazeyy Cinnazeyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zoriot Zoriot merged commit f467b7f into AlpsBTE:main May 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] - Create github actions workflow for jenkins build

5 participants