diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 36d42a20..8aa48b10 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -99,6 +99,19 @@ jobs: OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Abort and rollback staging release + if: ${{ failure() }} + run: |- + ./mvnw -B -e \ + -Dpassword='${{ secrets.GITHUB_TOKEN }}' \ + -DreleaseVersion="${release_version}" \ + -Dtag="v${release_version}" \ + release:rollback + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Create GitHub Release if: ${{ ! inputs.dry-run }} uses: ncipollo/release-action@v1