Merge pull request #84 from ArchipelagoMW/dependabot/gradle/org.apach… #33
This file contains hidden or 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
| name: Publish to Maven Central | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Build with Gradle | |
| # This just publishes to the local file system; jreleaser is responsible for uploading to maven central | |
| run: ./gradlew publish -Psnapshot=true | |
| - name: Upload to Maven Central Snapshots | |
| env: | |
| # Needs to have access to the io.github.ArchipelagoMW namespace in maven central | |
| JRELEASER_DEPLOY_MAVEN_NEXUS2_USERNAME: ${{ secrets.mavenCentralUsername }} | |
| JRELEASER_DEPLOY_MAVEN_NEXUS2_TOKEN: ${{ secrets.mavenCentralToken }} | |
| # The content uploaded to maven central needs to be signed. The public keys need to be published, | |
| # see https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key for accepted | |
| # locations | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.gpgPassphrase }} | |
| # The content here needs to be the values of the public and secret key pair | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.gpgPublicKey }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.gpgSecretKey }} | |
| JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_RELEASE_DEPLOY_ACTIVE: 'NEVER' | |
| run: ./gradlew jreleaserDeploy | |
| - name: Store JReleaser Logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jreleaser | |
| path: build/jreleaser | |
| - name: Store Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports | |
| path: build/reports |