Skip to content

Commit 443fcea

Browse files
committed
iterate on workflow syntax
1 parent 21de4d5 commit 443fcea

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

.github/workflows/swift.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ jobs:
3232
# git checkout 1bb5ae1b34aeb74009b7b4b5ebefc957cddc30a6
3333
echo "ldk-c-bindings commit hash:"
3434
git rev-parse HEAD
35-
cd ..
36-
- name: Install Swift Toolchain
37-
run: |
38-
curl --verbose -L -o swift-5.6-RELEASE-ubuntu20.04.tar.gz https://download.swift.org/swift-5.6-release/ubuntu2004/swift-5.6-RELEASE/swift-5.6-RELEASE-ubuntu20.04.tar.gz
39-
echo "Sha sum: $(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')"
40-
if [ "$(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')" != "${EXPECTED_SWIFT_SHASUM}" ]; then
41-
echo "Bad hash"
42-
echo "Contents: \n$(cat swift-5.6-RELEASE-ubuntu20.04.tar.gz)"
43-
exit 1
44-
fi
45-
tar xvvf swift-5.6-RELEASE-ubuntu20.04.tar.gz
46-
env:
47-
EXPECTED_SWIFT_SHASUM: 3f0d926bfc08eea00a69b1d992f2ab5e08155d97476096a3ef959fe7c4cbd58b
4835
- name: Install native Rust toolchain, Valgrind, and build utilities
4936
run: |
5037
sudo apt-get update
@@ -59,14 +46,6 @@ jobs:
5946
pwd
6047
./genbindings.sh ../rust-lightning true
6148
cd ..
62-
- name: Check that the latest headers are in the swift repo
63-
run: |
64-
git diff --exit-code bindings/LDK ':(exclude)bindings/LDK/Bindings.swift'
65-
- name: Debug bindings target directory structure
66-
run: |
67-
cd ci
68-
pwd
69-
python ./walker.py ldk-c-bindings/lightning-c-bindings/target
7049
- name: Copy new headers into bindings
7150
run: |
7251
cd ci
@@ -93,13 +72,28 @@ jobs:
9372
env:
9473
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH: ci/ldk-c-bindings/lightning-c-bindings/include/lightning.h
9574
LDK_SWIFT_GENERATOR_OUTPUT_DIRECTORY_PATH: ci/LDKSwift/Sources/LDKSwift
75+
- name: Debug generated Swift bindings directory structure
76+
run: |
77+
python ci/walker.py bindings/LDK
78+
- name: Check that the latest auto-generated Swift files are in the repo
79+
run: |
80+
git diff --exit-code bindings/LDK ':(exclude)bindings/LDK/Bindings.swift'
9681
- name: Fix Swift files
9782
run: |
9883
cd ci
9984
python ./fix_swift_imports.py
100-
- name: Debug CI directory structure
85+
- name: Install Swift Toolchain
10186
run: |
102-
python ci/walker.py ci/
87+
curl --verbose -L -o swift-5.6-RELEASE-ubuntu20.04.tar.gz https://download.swift.org/swift-5.6-release/ubuntu2004/swift-5.6-RELEASE/swift-5.6-RELEASE-ubuntu20.04.tar.gz
88+
echo "Sha sum: $(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')"
89+
if [ "$(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')" != "${EXPECTED_SWIFT_SHASUM}" ]; then
90+
echo "Bad hash"
91+
echo "Contents: \n$(cat swift-5.6-RELEASE-ubuntu20.04.tar.gz)"
92+
exit 1
93+
fi
94+
tar xvvf swift-5.6-RELEASE-ubuntu20.04.tar.gz
95+
env:
96+
EXPECTED_SWIFT_SHASUM: 3f0d926bfc08eea00a69b1d992f2ab5e08155d97476096a3ef959fe7c4cbd58b
10397
- name: Build Swift bindings package
10498
run: |
10599
cd ci/LDKSwift

0 commit comments

Comments
 (0)