-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate JReleaser for automated releases
- Add JReleaser Maven plugin - Updated `.gitignore` to include `.env.keys`. - Create GitHub Actions workflow for releasing new versions and publishing to Maven Central - Add JReleaser configuration file for changelog management
- Loading branch information
Showing
4 changed files
with
136 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
authors: | ||
- octocat | ||
|
||
categories: | ||
- title: 🎉 New Features | ||
labels: | ||
- enhancement | ||
- feature | ||
|
||
- title: 🐞 Bug Fixes | ||
labels: | ||
- bug | ||
|
||
- title: 📔 Documentation | ||
labels: | ||
- documentation | ||
|
||
- title: 🔨 Dependency Upgrades | ||
labels: | ||
- dependencies | ||
|
||
- title: Other Changes | ||
labels: | ||
- "*" | ||
|
||
- title: Breaking Changes 🛠 | ||
labels: | ||
- breaking-change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
branches: | ||
- 'feat/jreleaser' | ||
|
||
jobs: | ||
|
||
build: | ||
name: "Release new version and publish to the Maven Central Repository" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: maven | ||
|
||
- name: Retrieve release version from tag | ||
id: retrieve_release_version | ||
run: release_version=${GITHUB_REF_NAME#v}; echo "release_version=$release_version" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Set release version | ||
id: set_release_version | ||
run: mvn -B versions:set -DnewVersion=${{ steps.current_version.outputs.release_version }} | ||
|
||
- name: Commit & Push changes | ||
uses: actions-js/push@master | ||
Check warning on line 38 in .github/workflows/release.yml Codacy Production / Codacy Static Code Analysis.github/workflows/release.yml#L38
|
||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
message: Perform release ${{ github.event.inputs.version }} | ||
|
||
- name: Release to Maven Central | ||
env: | ||
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | ||
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | ||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | ||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | ||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: mvn -B -pl spring-mvc-test-utils -Prelease jreleaser:deploy | ||
|
||
- name: Set next development version | ||
run: mvn -B build-helper:parse-version versions:set-property -Dproperty=revision -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit | ||
|
||
- name: Commit & Push changes | ||
uses: actions-js/push@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
message: Set next development version | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters