create-new-github-release #19
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
permissions: write-all | |
name: create-new-github-release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseversion: | |
description: 'Release version (prefix with "v")' | |
required: true | |
default: 'v0.2.1' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
# server-id: oss.sonatype.org | |
# server-username: MAVEN_USERNAME | |
# server-password: MAVEN_PASSWORD | |
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_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 }}" --no-transfer-progress | |
- name: commit | |
run: mvn versions:commit | |
- name: Publish package | |
run: mvn --batch-mode clean deploy --no-transfer-progress -DskipTests=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# env: | |
# MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | |
# MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | |
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: push | |
run: | | |
git config --global user.name 'THMGraph Bot' | |
git config --global user.email "[email protected]" | |
git commit -am "mvn version bump" | |
git push | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/[email protected] | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.event.inputs.releaseversion }} | |
release_name: ${{ github.event.inputs.releaseversion }} | |
body: | | |
### Things that changed in this release | |
${{ steps.changelog.outputs.changelog }} | |
files: target/*jar | |
draft: false | |
prerelease: false |