-
Notifications
You must be signed in to change notification settings - Fork 12
105 lines (103 loc) · 4.25 KB
/
build-xcframework-parallel-libldk.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: XCFramework from libldks
permissions:
contents: read
statuses: read
pull-requests: read
actions: read
checks: write
on:
push:
branches:
- main
pull_request:
branches:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-libldks:
name: Build & lipo libldk.a for ${{ matrix.configuration['human_readable_platform'] }}
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings
strategy:
fail-fast: true
matrix:
configuration:
- platform_name: 'iphoneos'
human_readable_platform: 'iphoneos'
llvm_target_triple_suffix: ''
architectures: 'arm64'
- platform_name: 'iphonesimulator'
human_readable_platform: 'iphonesimulator'
llvm_target_triple_suffix: '-simulator'
architectures: 'arm64 x86_64'
- platform_name: 'macosx'
human_readable_platform: 'macosx'
llvm_target_triple_suffix: ''
architectures: 'arm64 x86_64'
- platform_name: 'macosx'
human_readable_platform: 'catalyst'
llvm_target_triple_suffix: '-macabi'
architectures: 'arm64 x86_64'
steps:
- name: Configure Xcode
if: matrix.configuration['human_readable_platform'] == 'catalyst'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
with:
destination: ./bindings/artifacts
- name: Build libldk.a
shell: bash
run:
python3 ./scripts/build_individual_libldk.py
env:
PLATFORM_NAME: ${{ matrix.configuration['platform_name'] }}
LLVM_TARGET_TRIPLE_SUFFIX: ${{ matrix.configuration['llvm_target_triple_suffix'] }}
ARCHS: ${{ matrix.configuration['architectures'] }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: bindings
path: |
./bindings/**/artifacts/ldk-c-bindings/lightning-c-bindings/include/*.h
./bindings/**/artifacts/ldk-c-bindings/ldk-net/ldk_net.*
./bindings/**/bin/release/${{ matrix.configuration['human_readable_platform'] }}/libldk.a
generate-parallel:
name: Build xcarchives and generate xcframework
needs: [ build-libldks ]
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
LDK_C_BINDINGS_BASE: ${{ github.workspace }}/bindings/artifacts/ldk-c-bindings
steps:
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Checkout
uses: actions/checkout@v3
- name: Download libldks
uses: actions/download-artifact@v3
- name: Generate Swift Bindings
shell: bash
run: |
npm install
# python3 ./
npm run tsc
node ./src/index.mjs
env:
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH: bindings/artifacts/ldk-c-bindings/lightning-c-bindings/include/lightning.h
- name: Generate xcframework
shell: bash
run:
python3 ./scripts/generate_xcframework.py
- name: Create XCFramework artifact
uses: ./.github/actions/upload-xcframework-artifact