Skip to content

Commit

Permalink
fix: release to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAtra committed Sep 5, 2023
1 parent 1cffb35 commit 7bffbe9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
packages: write
# used by aws-actions/configure-aws-credentials
id-token: write
outputs:
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }}
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -98,7 +101,8 @@ jobs:
run: |
terraform destroy -auto-approve
- name: Create new release
- id: semantic-release
name: Create new release
if: steps.run-tests.outcome == 'success'
uses: cycjimmy/semantic-release-action@v3
with:
Expand All @@ -112,6 +116,7 @@ jobs:
name: Publish to Maven Central
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs.new-release-published == 'true'
steps:
- uses: actions/checkout@v3

Expand All @@ -126,7 +131,9 @@ jobs:
server-password: MAVEN_PASSWORD

- name: Publish package
run: mvn -B -ntp -Ppublish-ossrh clean deploy -DskipTests
run: |
mvn -B -ntp versions:set -DgenerateBackupPoms=false -DnewVersion=${{ needs.build.outputs.new-release-version }}
mvn -B -ntp -Ppublish-ossrh clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 comments on commit 7bffbe9

Please sign in to comment.