Release #23
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version' | |
| required: true | |
| dry-run: | |
| description: 'Dry run' | |
| type: boolean | |
| required: true | |
| default: false | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
| restore-keys: ${{ runner.os }}-gradle- | |
| - name: Build | |
| run: ./gradlew build | |
| env: | |
| GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }} | |
| GH_PACKAGES_WRITE_TOKEN: ${{ secrets.GH_PACKAGES_WRITE_TOKEN }} | |
| IPREGISTRY_API_KEY: ${{ secrets.IPREGISTRY_API_KEY }} | |
| IPREGISTRY_DATASETS_SECRET_KEY: ${{ secrets.IPREGISTRY_DATASETS_SECRET_KEY }} | |
| - name: Publish artifacts to staging | |
| run: ./gradlew publish | |
| - name: Deploy to Maven Central and Create GitHub Release | |
| env: | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
| run: | | |
| mkdir -p build/jreleaser | |
| echo "=== Staging directory contents ===" | |
| find build/staging-deploy -type f -ls || echo "No staging directory found" | |
| echo "=== Running JReleaser Deploy ===" | |
| if ./gradlew jreleaserDeploy --stacktrace ${{ inputs.dry-run && '--dryrun' || '' }}; then | |
| echo "Maven deployment successful" | |
| else | |
| echo "Maven deployment failed - checking if artifacts already exist" | |
| if grep -q "already deployed" build/jreleaser/*.log 2>/dev/null; then | |
| echo "Artifacts already deployed to Maven Central - proceeding to GitHub release" | |
| else | |
| echo "Unexpected deployment error" | |
| exit 1 | |
| fi | |
| fi | |
| echo "=== Running JReleaser Release ===" | |
| ./gradlew jreleaserRelease --stacktrace ${{ inputs.dry-run && '--dryrun' || '' }} |