-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from RedHatInsights/ci/release-workflow
JReleaser-based release workflow
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 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,50 @@ | ||
# Inspired from https://foojay.io/today/how-to-release-a-java-module-with-jreleaser-to-maven-central-with-github-actions/ | ||
name: Publish a new release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version' | ||
required: true | ||
nextVersion: | ||
description: 'Next version after release (-SNAPSHOT will be added automatically)' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Java setup | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Set release version | ||
run: mvn --batch-mode versions:set -DnewVersion=${{ github.event.inputs.version }} | ||
- name: Commit & Push changes | ||
uses: actions-js/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
message: Releasing version ${{ github.event.inputs.version }} | ||
- name: Release with JReleaser | ||
uses: jreleaser/release-action@v2 | ||
with: | ||
setup-java: false | ||
env: | ||
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | ||
JRELEASER_TAG_NAME: ${{ github.event.inputs.version }} | ||
This comment has been minimized.
Sorry, something went wrong. |
||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set the next release version | ||
run: mvn --batch-mode versions:set -DnewVersion=${{ github.event.inputs.nextVersion }} | ||
- name: Commit & Push changes | ||
uses: actions-js/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
message: Setting SNAPSHOT version ${{ github.event.inputs.nextVersion }}-SNAPSHOT | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project: | ||
name: insights-java-client | ||
version: 999 # To be overriden by the environment variable JRELEASER_PROJECT_VERSION | ||
description: Red Hat Insights Java Client | ||
longDescription: Red Hat Insights Java Client | ||
authors: | ||
- Red Hat | ||
license: Apache-2.0 | ||
links: | ||
homepage: https://github.com/RedHatInsights/insights-java-client | ||
java: | ||
groupId: com.redhat.insight | ||
version: 11 | ||
|
||
release: | ||
github: | ||
owner: RedHatInsights | ||
changelog: | ||
links: true | ||
formatted: ALWAYS | ||
hide: | ||
contributors: | ||
- "GitHub" | ||
- "dependabot[bot]" | ||
- "[bot]" | ||
|
This could be replaced in
jreleaser.yml
by addingtagName: '{{projectVersion}}' inside the
release.github` section 😏