forked from lightningdevkit/ldk-node
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.5 KB
/
build-libraries.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
71
72
73
name: Build libraries for all targets
on:
workflow_call:
inputs:
rust_version:
required: true
type: string
jobs:
build:
strategy:
matrix:
build: [
{ host: ubuntu-20.04, tool: cargo, target: x86_64-unknown-linux-gnu, output: libldk_node.so },
{ host: ubuntu-20.04, tool: cross, target: aarch64-unknown-linux-gnu, output: libldk_node.so },
{ host: ubuntu-20.04, tool: cross, target: arm-unknown-linux-gnueabihf, output: libldk_node.so },
{ host: windows-2019, tool: cargo, target: x86_64-pc-windows-msvc, output: ldk_node.dll },
{ host: macos-12, tool: cargo, target: x86_64-apple-darwin, output: libldk_node.dylib },
{ host: macos-12, tool: cargo, target: aarch64-apple-darwin, output: libldk_node.dylib },
]
runs-on: ${{ matrix.build.host }}
steps:
- name: Set up Rust
run: |
rustup toolchain install ${{ inputs.rust_version }}
rustup default ${{ inputs.rust_version }}
- name: Add target
if: ${{ matrix.build.tool == 'cargo' }}
run: rustup target add ${{ matrix.build.target }}
- name: Install cross
if: ${{ matrix.build.tool == 'cross' }}
run: cargo install cross --git https://github.com/cross-rs/cross --rev c87a52a
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: ${{ matrix.build.tool }} build --release --target ${{ matrix.build.target }} --features uniffi
- name: Archive
uses: actions/upload-artifact@v4
with:
name: ldk-node-${{ matrix.build.target }}
path: target/${{ matrix.build.target }}/release/${{ matrix.build.output }}
make-macos-universal:
runs-on: macos-12
needs: build
steps:
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: ldk-node-x86_64-apple-darwin
path: x86_64-apple-darwin
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: ldk-node-aarch64-apple-darwin
path: aarch64-apple-darwin
- name: Make universal library
run: |
lipo -create -output "libldk_node.dylib" "x86_64-apple-darwin/libldk_node.dylib" "aarch64-apple-darwin/libldk_node.dylib"
- name: Archive universal library
uses: actions/upload-artifact@v4
with:
name: ldk-node-universal-apple-darwin
path: libldk_node.dylib