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 ${{ github.event.inputs.release-version }} | ||
Check failure on line 1 in .github/workflows/release.yml GitHub Actions / Release ${{ github.event.inputs.release-version }}Invalid workflow file
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: The version to release | ||
required: true | ||
next-development-version: | ||
description: The next development version | ||
required: true | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
check-latest: true | ||
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#publishing-using-apache-maven | ||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | ||
server-username: MAVEN_USERNAME # env variable for username in deploy | ||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
- name: Prepare Release | ||
run: mvn versions:set -DnewVersion="${{ github.event.inputs.release-version }}" | ||
- name: Verify Release | ||
run: mvn verify | ||
- name: Tag the ${{ github.event.inputs.release-version }} Release | ||
run: | | ||
git config --local user.name "Rob Winch" | ||
git config --local user.email "[email protected]" | ||
git commit -am 'Release ${{ github.event.inputs.release-version }} [no ci]' | ||
git tag "v${{ github.event.inputs.release-version }}" | ||
git push origin "v${{ github.event.inputs.release-version }}" | ||
- name: Push to Maven Central | ||
run: | | ||
mvn deploy -Possrh | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} | ||
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- name: Prepare Next Development Version | ||
run: mvn versions:set -DnewVersion="${{ github.event.inputs.next-development-version }}" | ||
- name: Push Next Development Version | ||
run: | | ||
git commit -am 'Next Development Version ${{ github.event.inputs.next-development-version }}' | ||
git push origin ${GITHUB_REF_NAME:-main} |