-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (61 loc) · 2.49 KB
/
publish-java.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Publish Java
on:
workflow_dispatch:
jobs:
release-linux:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- binary: libyggdrasilffi_x86_64.so
platform: x86_64-linux
# - binary: libyggdrasilffi_arm64.so
# platform: arm-linux
# - binary: libyggdrasilffi_x86_64-musl.so
# platform: x86_64-linux-musl
# - binary: libyggdrasilffi_arm64-musl.so
# platform: aarch64-linux-musl
# - binary: yggdrasilffi_x86_64.dll
# platform: x64-mingw32
# - binary: yggdrasilffi_arm64.dll
# platform: arm64-mingw32
# - binary: libyggdrasilffi_x86_64.dylib
# platform: x86_64-darwin
# - binary: libyggdrasilffi_arm64.dylib
# platform: arm64-darwin
steps:
- uses: actions/checkout@v4
- name: Extract Yggdrasil Core Version
run: |
cd java-engine
CORE_VERSION=$(grep -E '^yggdrasilCoreVersion=' gradle.properties | cut -d'=' -f2)
echo "FFI Library Version: $CORE_VERSION"
echo "CORE_VERSION=$CORE_VERSION" >> $GITHUB_ENV
- name: Set Platform Property for Gradle
run: |
echo "platform=${{ matrix.platform }}" >> $GITHUB_ENV
- name: Download Binary
run: |
BINARY_URL="https://github.com/${{ github.repository }}/releases/download/unleash-yggdrasil-v${CORE_VERSION}/${{ matrix.binary }}"
TARGET_DIR="java-engine/src/main/resources/native"
mkdir -p "$TARGET_DIR"
curl -L -o "$TARGET_DIR/${{ matrix.binary }}" \
-H "Authorization: token $GITHUB_TOKEN" \
"$BINARY_URL"
if [ -f "$TARGET_DIR/${{ matrix.binary }}" ]; then
echo "${{ matrix.binary }} downloaded successfully to $TARGET_DIR."
else
echo "Error: ${{ matrix.binary }} could not be downloaded."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Sonatype
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.GPG_PASSPHRASE }}
run: |
cd java-engine
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pplatform=${{ matrix.platform }}