2024-09-09 20:19:26 +02:00
|
|
|
name: java
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-11-17 14:33:57 +01:00
|
|
|
tags:
|
|
|
|
- 'v*.*.*'
|
2024-09-09 20:19:26 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform:
|
|
|
|
- runner: ubuntu-latest
|
|
|
|
target: linux-x64-gnu
|
|
|
|
filename: libcodemp.so
|
|
|
|
- runner: windows-latest
|
|
|
|
target: win32-x64
|
|
|
|
filename: codemp.dll
|
|
|
|
- runner: macos-14
|
|
|
|
target: darwin-arm64
|
2024-10-15 00:37:01 +02:00
|
|
|
filename: libcodemp.dylib
|
2024-09-09 20:19:26 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: arduino/setup-protoc@v3
|
2024-09-10 14:51:58 +02:00
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2024-10-15 00:37:01 +02:00
|
|
|
- run: cargo build --release --features=java
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: codemp-java-${{ matrix.platform.target }}
|
|
|
|
path: target/release/${{ matrix.platform.filename }}
|
|
|
|
|
|
|
|
publish:
|
|
|
|
needs: [build]
|
2024-10-15 00:44:16 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-10-15 00:37:01 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
path: dist/java/artifacts
|
|
|
|
pattern: codemp-java-*
|
2024-10-15 15:31:52 +02:00
|
|
|
merge-multiple: true
|
2024-10-15 14:56:41 +02:00
|
|
|
- run: tree
|
|
|
|
working-directory: dist/java
|
2024-09-18 13:21:13 +02:00
|
|
|
- uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: '11'
|
2024-09-09 20:19:26 +02:00
|
|
|
- uses: gradle/actions/setup-gradle@v4
|
|
|
|
with:
|
2024-10-15 00:37:01 +02:00
|
|
|
gradle-version: "8.10"
|
2024-09-18 16:01:56 +02:00
|
|
|
- run: gradle publish
|
2024-09-18 02:44:19 +02:00
|
|
|
working-directory: dist/java
|
2024-09-18 02:40:55 +02:00
|
|
|
env:
|
2024-09-18 04:09:51 +02:00
|
|
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
|
|
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
|
|
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }}
|
|
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
|
2024-10-15 00:37:01 +02:00
|
|
|
|