Add back javadoc needed for publishing #139
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags-ignore: | |
| - '**' | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: gradle | |
| - name: Build and run tests | |
| run: ./gradlew clean build --console=plain --stacktrace --no-daemon | |
| snapshots: | |
| name: Publish Snapshots | |
| needs: [ test ] | |
| runs-on: ubuntu-latest | |
| # Only publish snapshots on push to main (never on PRs) | |
| if: github.event_name == 'push' && github.ref_name == 'main' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: gradle | |
| - name: Compute next snapshot version from latest v* tag | |
| id: ver | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| latest="$(git tag -l 'v*' --sort=-v:refname | head -n 1 || true)" | |
| echo "LATEST_TAG=$latest" >> "$GITHUB_OUTPUT" | |
| if [[ -z "$latest" ]]; then | |
| echo "SNAPSHOT_VERSION=0.1.0-SNAPSHOT" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| v="${latest#v}" | |
| IFS='.' read -r major minor patch <<< "$v" | |
| patch=$((patch + 1)) | |
| echo "SNAPSHOT_VERSION=${major}.${minor}.${patch}-SNAPSHOT" >> "$GITHUB_OUTPUT" | |
| - name: Show resolved snapshot version | |
| shell: bash | |
| run: | | |
| echo "Latest release tag found: ${{ steps.ver.outputs.LATEST_TAG }}" | |
| echo "Resolved snapshot version: ${{ steps.ver.outputs.SNAPSHOT_VERSION }}" | |
| - name: Publish snapshot to Maven Central snapshots | |
| run: ./gradlew publish --console=plain --stacktrace --no-daemon | |
| env: | |
| ORG_GRADLE_PROJECT_snapshotVersion: ${{ steps.ver.outputs.SNAPSHOT_VERSION }} | |
| ORG_GRADLE_PROJECT_centralTokenUsername: ${{ secrets.CENTRAL_TOKEN_USERNAME }} | |
| ORG_GRADLE_PROJECT_centralTokenPassword: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY_ARMORED }} | |
| ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.GPG_PASSPHRASE }} |