forked from lightningdevkit/ldk-node
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (74 loc) · 2.82 KB
/
publish-jvm.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Publish ldk-node-jvm to Maven Central
on: [workflow_dispatch]
jobs:
build-jvm-macOS-M1-native-lib:
name: "Create M1 and x86_64 JVM native binaries"
runs-on: macos-12
steps:
- name: "Checkout publishing branch"
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: Install aarch64 Rust target
run: rustup target add aarch64-apple-darwin
- name: Build ldk-node-jvm library
run: |
./scripts/uniffi_bindgen_generate_kotlin.sh
# build aarch64 + x86_64 native libraries and upload
- name: Upload macOS native libraries for reuse in publishing job
uses: actions/upload-artifact@v3
with:
# name: no name is required because we upload the entire directory
# the default name "artifact" will be used
path: /Users/runner/work/ldk-node/ldk-node/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/
build-jvm-full-library:
name: "Create full ldk-node-jvm library"
needs: [build-jvm-macOS-M1-native-lib]
runs-on: ubuntu-20.04
steps:
- name: "Check out PR branch"
uses: actions/checkout@v2
- name: "Cache"
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: "Set up JDK"
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: "Build ldk-node-jvm library"
run: |
./scripts/uniffi_bindgen_generate_kotlin.sh
- name: Download macOS native libraries from previous job
uses: actions/[email protected]
id: download
with:
# download the artifact created in the prior job (named "artifact")
name: artifact
path: ./bindings/kotlin/ldk-node-jvm/lib/src/main/resources/
- name: "Publish to Maven Local and Maven Central"
env:
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.NEXUS_PASSWORD }}
run: |
cd bindings/kotlin/ldk-node-jvm
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository