-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to trigger a new release
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
with: | ||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Set up JDK | ||
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
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 "[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 | ||
- 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." |