Skip to content

Commit

Permalink
Add staging repository creation to workflow
Browse files Browse the repository at this point in the history
Introduce a new job to create a Sonatype staging repository before publishing artifacts. This ensures the repository is prepped and ready for artifact release, improving the reliability of the publishing process. The signing credentials have been removed from the close and release step, aligning with new security practices.
  • Loading branch information
lamba92 committed Dec 2, 2024
1 parent c74b4e2 commit 7112cc0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,24 @@ on:
types: [ published ]

jobs:
create-staging-repository:
runs-on: ubuntu-latest
name: "Create Sonatype Staging Repository"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- uses: gradle/actions/setup-gradle@v4
- run: chmod +x gradlew
- run: ./gradlew initializeSonatypeStagingRepository
env:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

publish-artifacts:
needs: [ create-staging-repository ]
strategy:
matrix:
os: [ ubuntu, windows, macos ]
Expand Down Expand Up @@ -42,7 +59,5 @@ jobs:
- run: chmod +x gradlew
- run: ./gradlew closeAndReleaseSonatypeStagingRepository
env:
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_PRIVATE_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

0 comments on commit 7112cc0

Please sign in to comment.