Skip to content

Commit 16af3f4

Browse files
build: update release workflow
1 parent 18fcb36 commit 16af3f4

File tree

1 file changed

+24
-37
lines changed

1 file changed

+24
-37
lines changed

.github/workflows/publish-spm.yaml

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,82 +16,69 @@ jobs:
1616
name: Build, tag and create release
1717
runs-on: macos-12
1818
steps:
19-
- name: Checkout build repo
19+
- name: "Checkout build repo"
2020
uses: actions/checkout@v3
2121
with:
2222
repository: ${{ github.repository_owner }}/bdk-ffi
2323
path: build
2424
ref: ${{ inputs.ffitag }}
2525

26-
- name: Checkout dist repo
26+
- name: "Checkout dist repo"
2727
uses: actions/checkout@v3
2828
with:
2929
path: dist
3030

31-
- name: Install Rust targets
32-
working-directory: build
31+
- name: "Install Rust targets"
32+
working-directory: build/bdk-ffi
3333
run: |
34-
rustup install nightly-2023-04-10
35-
rustup component add rust-src --toolchain nightly-2023-04-10
36-
rustup target add aarch64-apple-ios x86_64-apple-ios
37-
rustup target add aarch64-apple-ios-sim --toolchain nightly-2023-04-10
38-
rustup target add aarch64-apple-darwin x86_64-apple-darwin
34+
rustup install 1.73.0
35+
rustup component add rust-src
36+
rustup target add aarch64-apple-ios # iOS ARM64
37+
rustup target add x86_64-apple-ios # iOS x86_64
38+
rustup target add aarch64-apple-ios-sim # simulator mac M1
39+
rustup target add aarch64-apple-darwin # mac M1
40+
rustup target add x86_64-apple-darwin # mac x86_64
3941
40-
- name: Run bdk-ffi-bindgen
42+
- name: "Run bdk-ffi-bindgen"
4143
working-directory: build/bdk-ffi
4244
run: |
4345
cargo run --bin uniffi-bindgen generate src/bdk.udl --language swift --out-dir ../bdk-swift/Sources/BitcoinDevKit --no-format
44-
- name: Build bdk-ffi for x86_64-apple-darwin
45-
working-directory: build
46+
47+
- name: "Build bdk-ffi for all targets"
48+
working-directory: build/bdk-ffi
4649
run: |
4750
cargo build --profile release-smaller --target x86_64-apple-darwin
48-
49-
- name: Build bdk-ffi for aarch64-apple-darwin
50-
working-directory: build
51-
run: |
5251
cargo build --profile release-smaller --target aarch64-apple-darwin
53-
54-
- name: Build bdk-ffi for x86_64-apple-ios
55-
working-directory: build
56-
run: |
5752
cargo build --profile release-smaller --target x86_64-apple-ios
58-
59-
- name: Build bdk-ffi for aarch64-apple-ios
60-
working-directory: build
61-
run: |
6253
cargo build --profile release-smaller --target aarch64-apple-ios
54+
cargo build --profile release-smaller --target aarch64-apple-ios-sim
6355
64-
- name: Build bdk-ffi for aarch64-apple-ios-sim
65-
working-directory: build
66-
run: |
67-
cargo +nightly-2023-04-10 build --profile release-smaller --target aarch64-apple-ios-sim
68-
69-
- name: Create lipo-ios-sim and lipo-macos
70-
working-directory: build
56+
- name: "Create lipo-ios-sim and lipo-macos"
57+
working-directory: build/bdk-ffi
7158
run: |
7259
mkdir -p target/lipo-ios-sim/release-smaller
7360
lipo target/aarch64-apple-ios-sim/release-smaller/libbdkffi.a target/x86_64-apple-ios/release-smaller/libbdkffi.a -create -output target/lipo-ios-sim/release-smaller/libbdkffi.a
7461
mkdir -p target/lipo-macos/release-smaller
7562
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
7663
77-
- name: Create bdkFFI.xcframework
64+
- name: "Create bdkFFI.xcframework"
7865
working-directory: build/bdk-swift
7966
run: |
8067
mv Sources/BitcoinDevKit/bdk.swift Sources/BitcoinDevKit/BitcoinDevKit.swift
8168
cp Sources/BitcoinDevKit/bdkFFI.h bdkFFI.xcframework/ios-arm64/bdkFFI.framework/Headers
8269
cp Sources/BitcoinDevKit/bdkFFI.h bdkFFI.xcframework/ios-arm64_x86_64-simulator/bdkFFI.framework/Headers
8370
cp Sources/BitcoinDevKit/bdkFFI.h bdkFFI.xcframework/macos-arm64_x86_64/bdkFFI.framework/Headers
84-
cp ../target/aarch64-apple-ios/release-smaller/libbdkffi.a bdkFFI.xcframework/ios-arm64/bdkFFI.framework/bdkFFI
85-
cp ../target/lipo-ios-sim/release-smaller/libbdkffi.a bdkFFI.xcframework/ios-arm64_x86_64-simulator/bdkFFI.framework/bdkFFI
86-
cp ../target/lipo-macos/release-smaller/libbdkffi.a bdkFFI.xcframework/macos-arm64_x86_64/bdkFFI.framework/bdkFFI
71+
cp ../bdk-ffi/target/aarch64-apple-ios/release-smaller/libbdkffi.a bdkFFI.xcframework/ios-arm64/bdkFFI.framework/bdkFFI
72+
cp ../bdk-ffi/target/lipo-ios-sim/release-smaller/libbdkffi.a bdkFFI.xcframework/ios-arm64_x86_64-simulator/bdkFFI.framework/bdkFFI
73+
cp ../bdk-ffi/target/lipo-macos/release-smaller/libbdkffi.a bdkFFI.xcframework/macos-arm64_x86_64/bdkFFI.framework/bdkFFI
8774
rm Sources/BitcoinDevKit/bdkFFI.h
8875
rm Sources/BitcoinDevkit/bdkFFI.modulemap
8976
rm bdkFFI.xcframework.zip || true
9077
zip -9 -r bdkFFI.xcframework.zip bdkFFI.xcframework
9178
echo "BDKFFICHECKSUM=`swift package compute-checksum bdkFFI.xcframework.zip`" >> $GITHUB_ENV
9279
echo "BDKFFIURL=https\:\/\/github\.com\/${{ github.repository_owner }}\/bdk\-swift\/releases\/download\/${{ inputs.version }}\/bdkFFI\.xcframework\.zip" >> $GITHUB_ENV
9380
94-
- name: Update and tag release dist repo
81+
- name: "Update and tag release dist repo"
9582
working-directory: build/bdk-swift
9683
run: |
9784
echo checksum = ${{ env.BDKFFICHECKSUM }}
@@ -106,7 +93,7 @@ jobs:
10693
git tag ${{ inputs.version }} -m "Release ${{ inputs.version }}"
10794
git push --tags
10895
109-
- name: Create release
96+
- name: "Create release"
11097
uses: ncipollo/release-action@v1
11198
with:
11299
artifacts: "build/bdk-swift/bdkFFI.xcframework.zip"

0 commit comments

Comments
 (0)