Workflow file for this run
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
| # This workflow publishes to Maven Central using JReleaser when a GitHub release is created | |
| # For more information see: https://jreleaser.org/guide/latest/examples/maven/maven-central.html | |
| name: Publish Release with JReleaser | |
| on: | |
| release: | |
| types: [ released ] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed for JReleaser to update the release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for JReleaser git operations | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '18' | |
| distribution: 'temurin' | |
| - name: Stage artifacts to local directory | |
| env: | |
| LIBRARY_VERSION: ${{ github.event.release.tag_name }} | |
| run: | | |
| ./gradlew :DittoToolsAndroid:publishReleasePublicationToLocalStagingRepository -PLIBRARY_VERSION=${{ github.event.release.tag_name }} | |
| - name: Publish to Maven Central via JReleaser | |
| env: | |
| # Library version from release tag | |
| LIBRARY_VERSION: ${{ github.event.release.tag_name }} | |
| # GitHub token for JReleaser (provided by GitHub Actions) | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Map existing Maven Central secrets to JReleaser variables | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVEN_CENTRAL_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVEN_CENTRAL_PASSWORD }} | |
| # Map existing GPG secrets to JReleaser variables | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.ORG_GRADLE_PROJECT_GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.ORG_GRADLE_PROJECT_GPG_SIGNING_IN_MEMORY_KEY }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_GPG_SIGNING_IN_MEMORY_KEY_PWD }} | |
| run: | | |
| ./gradlew :DittoToolsAndroid:jreleaserFullRelease -PLIBRARY_VERSION=${{ github.event.release.tag_name }} |