From 49590376eb2b16202acad8af277b3b11bb903df1 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Sun, 22 Oct 2023 13:45:43 +0200 Subject: [PATCH] Add trigger release workflow --- .github/workflows/trigger-release.yml | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/trigger-release.yml diff --git a/.github/workflows/trigger-release.yml b/.github/workflows/trigger-release.yml new file mode 100644 index 0000000..c24d955 --- /dev/null +++ b/.github/workflows/trigger-release.yml @@ -0,0 +1,48 @@ +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@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + - name: Set up JDK + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3 + with: + distribution: 'zulu' + java-version: '17' + cache: 'maven' + server-id: ossrh + server-username: ${{ secrets.CI_DEPLOY_USERNAME }} + server-password: ${{ secrets.CI_DEPLOY_PASSWORD }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + - name: Set up Git + run: | + git config --global committer.email "48418865+dropwizard-committers@users.noreply.github.com" + 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 + - 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."