Build Java SDK java/v1.1.0 #8
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: Build Java | |
| run-name: "Build Java SDK ${{ github.ref_name }}" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| jni-run-id: | |
| description: "Run ID of the release-jni.yml build containing JNI artifacts." | |
| required: true | |
| type: string | |
| jobs: | |
| build-jar: | |
| runs-on: | |
| group: databricks-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Get JFrog OIDC token | |
| shell: bash | |
| run: bash "$GITHUB_WORKSPACE/.github/scripts/jfrog-oidc-token.sh" | |
| - name: Download JNI artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh run download "${{ inputs.jni-run-id }}" \ | |
| --repo databricks/zerobus-sdk \ | |
| --pattern 'jni-*' \ | |
| --dir jni-artifacts/ | |
| echo "Downloaded JNI artifacts:" | |
| find jni-artifacts/ -type f | sort | |
| - name: Place JNI libraries in native directory | |
| working-directory: java | |
| run: | | |
| for dir in ../jni-artifacts/jni-*/; do | |
| platform=$(basename "$dir" | sed 's/jni-//') | |
| mkdir -p src/main/resources/native/"$platform" | |
| cp "$dir"/* src/main/resources/native/"$platform"/ | |
| done | |
| - name: Set up Java | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: 11 | |
| distribution: temurin | |
| - name: Configure Maven registry | |
| shell: bash | |
| run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-maven.sh" | |
| - name: Build JAR | |
| working-directory: java | |
| run: mvn -DskipTests=true --batch-mode package | |
| - name: Upload JAR | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: java-jar | |
| path: | | |
| java/target/*.jar | |
| java/target/*.pom | |
| if-no-files-found: error |