Release New Version #14
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
name: Release New Version | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseversion: | |
description: 'Release version' | |
required: true | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- run: | | |
echo "Release version ${{ github.event.inputs.releaseversion }}!" | |
- name: Set projects Maven version to GitHub Action GUI set version | |
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" | |
# - name: Deploy to Github packages | |
# run: mvn --batch-mode clean deploy -Pgithub | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Deploy to Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} | |
# gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Set projects Maven version to GitHub Action GUI set version | |
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" | |
- name: Publish to the Maven Central Repository | |
run: mvn --batch-mode clean deploy -Possrh | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/[email protected] | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.releaseversion }} | |
release_name: ${{ github.event.inputs.releaseversion }} | |
body: | | |
### Things that changed in this release | |
${{ steps.changelog.outputs.changelog }} | |
draft: false | |
prerelease: false | |