Trigger Release #17
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: Trigger Release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: 'Version of the next release' | |
required: true | |
developmentVersion: | |
description: 'Version of the next development cycle (must end in "-SNAPSHOT")' | |
required: true | |
jobs: | |
trigger-release: | |
runs-on: 'ubuntu-latest' | |
permissions: | |
contents: write | |
env: | |
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" | |
steps: | |
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Set up JDK | |
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
server-id: ossrh | |
server-username: ${{ secrets.CI_DEPLOY_USERNAME }} | |
server-password: ${{ secrets.CI_DEPLOY_PASSWORD }} | |
- name: Set up Git | |
run: | | |
git config --global committer.email "[email protected]" | |
git config --global committer.name "Dropwizard Release Action" | |
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global author.name "${GITHUB_ACTOR}" | |
- name: Prepare release | |
run: ./mvnw -V -B -ntp -Prelease -DreleaseVersion=${{ inputs.releaseVersion }} -DdevelopmentVersion=${{ inputs.developmentVersion }} release:prepare | |
env: | |
MAVEN_GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Rollback on failure | |
if: failure() | |
run: | | |
./mvnw -B release:rollback -Prelease | |
echo "You may need to manually delete the GitHub tag, if it was created." |