Skip to content

Commit

Permalink
Attempting to fix the rollback
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Springett <[email protected]>
  • Loading branch information
stevespringett committed Oct 25, 2024
1 parent 1d1532f commit 289cb5a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,18 @@ jobs:
echo "options=release:clean release:prepare release:perform -Prelease" >> $GITHUB_ENV
fi
- name: Run Maven command
# This requires the connection and developerConnection elements in the scm section of the pom
# to be set to "scm:git:https:...." thus preventing the release plugin from using SSH.
- name: Run Maven command and capture exit code
id: run_maven
run: |
mvn -B ${{ env.options }}
mvn -B ${{ env.options }} || echo "Maven failed" > /tmp/maven_failed
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: ${{ github.event.inputs.dry_run == false }}

- name: Rollback if release fails
if: failure() && github.event.inputs.dry_run == false
if: ${{ steps.run_maven.outcome == 'failure' && github.event.inputs.dry_run == false }}
run: |
echo "Release failed. Rolling back..."
mvn -B release:rollback -Prelease
Expand Down

0 comments on commit 289cb5a

Please sign in to comment.