Skip to content

Commit cd3a101

Browse files
committed
Test building xcframework based on parallelized libldk.a builds.
1 parent 332ca87 commit cd3a101

File tree

1 file changed

+78
-1
lines changed

1 file changed

+78
-1
lines changed

.github/workflows/build-frameworks.yml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,82 @@ on:
1414
- "*"
1515

1616
jobs:
17+
build-libldks:
18+
name: Build lipo libldk.a for ${{ matrix.configuration['human_readable_platform'] }}
19+
runs-on: macos-12
20+
env:
21+
LDK_C_BINDINGS_BASE: /Users/runner/work/ldk-swift/ldk-swift/bindings/artifacts/ldk-c-bindings
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
configuration:
26+
- platform_name: 'iphoneos'
27+
human_readable_platform: 'iphoneos'
28+
llvm_target_triple_suffix: ''
29+
architectures: 'arm64'
30+
- platform_name: 'iphonesimulator'
31+
human_readable_platform: 'iphonesimulator'
32+
llvm_target_triple_suffix: '-simulator'
33+
architectures: 'arm64 x86_64'
34+
- platform_name: 'macosx'
35+
human_readable_platform: 'macosx'
36+
llvm_target_triple_suffix: ''
37+
architectures: 'arm64 x86_64'
38+
- platform_name: 'macosx'
39+
human_readable_platform: 'catalyst'
40+
llvm_target_triple_suffix: '-macabi'
41+
architectures: 'arm64 x86_64'
42+
steps:
43+
- name: Configure Xcode
44+
if: matrix.configuration['human_readable_platform'] == 'catalyst'
45+
uses: maxim-lobanov/setup-xcode@v1
46+
with:
47+
xcode-version: latest
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
- name: Install Dependencies
51+
uses: ./.github/actions/install-dependencies
52+
- name: Build libldk.a
53+
shell: bash
54+
run:
55+
python3 ./src/scripts/build_individual_libldk.py
56+
env:
57+
PLATFORM_NAME: ${{ matrix.configuration['platform_name'] }}
58+
LLVM_TARGET_TRIPLE_SUFFIX: ${{ matrix.configuration['llvm_target_triple_suffix'] }}
59+
ARCHS: ${{ matrix.configuration['architectures'] }}
60+
- name: Upload binary
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: libldk-${{ matrix.configuration['human_readable_platform'] }}.a
64+
path: |
65+
/Users/runner/work/ldk-swift/ldk-swift/bindings/bin/release/${{ matrix.configuration['human_readable_platform'] }}/libldk.a
66+
generate-parallel:
67+
name: Generate XCFramework based on parallelized libldk builds
68+
needs: [ build-libldks ]
69+
runs-on: macos-12
70+
env:
71+
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
72+
LDK_C_BINDINGS_BASE: /Users/runner/work/ldk-swift/ldk-swift/bindings/artifacts/ldk-c-bindings
73+
steps:
74+
- name: Configure Xcode
75+
uses: maxim-lobanov/setup-xcode@v1
76+
with:
77+
xcode-version: latest
78+
- name: Checkout
79+
uses: actions/checkout@v2
80+
- name: Download xcarchives
81+
uses: actions/download-artifact@v3
82+
- name: Generate Swift Bindings
83+
shell: bash
84+
run: |
85+
python3 ./
86+
env:
87+
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH: bindings/artifacts/ldk-c-bindings/lightning-c-bindings/include/lightning.h
88+
- name: Generate xcframework
89+
shell: bash
90+
run:
91+
python3 ./src/scripts/generate_xcframework.py
92+
1793
build:
1894
name: Build XCArchive for ${{ matrix.configuration['platform'] }}
1995
runs-on: macos-12
@@ -57,7 +133,8 @@ jobs:
57133
project: ${{ matrix.configuration['project'] }}
58134
scheme: ${{ matrix.configuration['scheme'] }}
59135
destination: ${{ matrix.configuration['destination'] }}
60-
generate:
136+
137+
generate-sequential:
61138
name: Generate XCFramework
62139
runs-on: macos-12
63140
env:

0 commit comments

Comments
 (0)