| ################################################################################ |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ################################################################################ |
| |
| name: Release Java |
| |
| on: |
| workflow_call: |
| workflow_dispatch: |
| |
| env: |
| JDK_VERSION: 8 |
| |
| concurrency: |
| group: release-java-${{ github.ref }} |
| cancel-in-progress: false |
| |
| jobs: |
| build-native: |
| runs-on: ${{ matrix.os }} |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - os: ubuntu-latest |
| target: x86_64-unknown-linux-gnu |
| os_name: linux |
| arch: x86_64 |
| lib_name: libpaimon_mosaic_jni.so |
| - os: ubuntu-24.04-arm |
| target: aarch64-unknown-linux-gnu |
| os_name: linux |
| arch: aarch64 |
| lib_name: libpaimon_mosaic_jni.so |
| - os: macos-latest |
| target: aarch64-apple-darwin |
| os_name: macos |
| arch: aarch64 |
| lib_name: libpaimon_mosaic_jni.dylib |
| - os: windows-latest |
| target: x86_64-pc-windows-msvc |
| os_name: windows |
| arch: x86_64 |
| lib_name: paimon_mosaic_jni.dll |
| steps: |
| - uses: actions/checkout@v6 |
| |
| - name: Setup Rust toolchain |
| run: | |
| rustup update stable |
| rustup default stable |
| |
| - name: Build JNI library |
| run: cargo build --release -p paimon-mosaic-jni |
| |
| - name: Upload native library |
| uses: actions/upload-artifact@v5 |
| with: |
| name: native-${{ matrix.os_name }}-${{ matrix.arch }} |
| path: target/release/${{ matrix.lib_name }} |
| |
| deploy-staging: |
| if: github.repository == 'apache/paimon-mosaic' && startsWith(github.ref, 'refs/tags/') |
| runs-on: ubuntu-latest |
| needs: [build-native] |
| steps: |
| - uses: actions/checkout@v6 |
| |
| - name: Download linux x86_64 native library |
| uses: actions/download-artifact@v5 |
| with: |
| name: native-linux-x86_64 |
| path: java/src/main/resources/native/linux/x86_64 |
| |
| - name: Download linux aarch64 native library |
| uses: actions/download-artifact@v5 |
| with: |
| name: native-linux-aarch64 |
| path: java/src/main/resources/native/linux/aarch64 |
| |
| - name: Download macOS aarch64 native library |
| uses: actions/download-artifact@v5 |
| with: |
| name: native-macos-aarch64 |
| path: java/src/main/resources/native/macos/aarch64 |
| |
| - name: Download windows x86_64 native library |
| uses: actions/download-artifact@v5 |
| with: |
| name: native-windows-x86_64 |
| path: java/src/main/resources/native/windows/x86_64 |
| |
| - name: Verify native libraries |
| run: find java/src/main/resources/native -type f | sort |
| |
| - name: Set up JDK ${{ env.JDK_VERSION }} |
| uses: actions/setup-java@v4 |
| with: |
| java-version: ${{ env.JDK_VERSION }} |
| distribution: 'temurin' |
| server-id: apache.releases.https |
| server-username: MAVEN_USERNAME |
| server-password: MAVEN_PASSWORD |
| gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE |
| |
| - name: Deploy to Apache Nexus staging |
| working-directory: java |
| run: | |
| mvn clean deploy \ |
| -Prelease \ |
| -DskipTests \ |
| -DretryFailedDeploymentCount=10 |
| env: |
| MAVEN_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} |
| MAVEN_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |