Skip to content

Commit 573370c

Browse files
cdeckerclaude
andcommitted
ci: harden CI workflows and fix prebuilt wheel testing
Iterate on the CI orchestrator and reusable build workflows to reliably test against prebuilt artifacts without rebuilding from source. Key changes: Workflow infrastructure: - Add build-test-binaries.yml for gl-plugin and gl-signerproxy artifacts - Install cfssl from prebuilt release binaries instead of Go toolchain - Modernize all third-party actions to 2026 versions (v6/v7/v8) - Add protoc repo-token to avoid GitHub API rate limiting - Fix macOS builds: native hosts (macos-13/macos-14) for architecture match - Fix Windows: set Python architecture for x86 builds - Fix Linux: chown maturin Docker output to restore user permissions - Per-architecture rust-cache namespaces to avoid target collisions Python wheel testing (python-test job): - Install gl-testing with --no-deps to avoid uv workspace source resolution rebuilding gl-client from source via maturin - Install remaining deps explicitly, excluding workspace packages - Use uv run --no-sync to prevent workspace re-resolution - Use uv venv --clear (clnvm creates a .venv first) - Add bitcoind, cfssl, lightningd (clnvm) for integration test fixtures - Set CARGO_TARGET_DIR so gl-testing finds downloaded test binaries N-API testing (napi-test job): - Use absolute workspace paths for pip install (working-directory offset) - Install gl-sdk wheel alongside gl-client - Spawn gltestserver with uv run --no-sync (not uv run --package) - Download prebuilt test binaries instead of compiling Rust locally - Set CARGO_TARGET_DIR for gl-testing binary discovery gl-sdk wheel packaging: - Force-include glsdk/glsdk.py in hatchling build hook (gitignored by default, so the UniFFI Python bindings were missing from the wheel) - Retag wheel from py3-none-any to correct platform tag since it contains native libglsdk.so/.dylib/.dll Also includes cargo fmt and Cargo.toml dependency consolidation from the parent branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ea18bef commit 573370c

49 files changed

Lines changed: 560 additions & 386 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-kotlin.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010

1111
jobs:
1212
build:
13-
name: Build Kotlin Multiplatform Bindings
13+
name: Build Kotlin Multiplatform Bindings (macOS)
1414
runs-on: macos-15
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
with:
1818
ref: ${{ inputs.ref }}
1919

2020
- name: Set up JDK
21-
uses: actions/setup-java@v4
21+
uses: actions/setup-java@v5
2222
with:
2323
distribution: temurin
2424
java-version: 21
@@ -35,6 +35,8 @@ jobs:
3535
x86_64-apple-ios
3636
3737
- uses: Swatinem/rust-cache@v2
38+
with:
39+
shared-key: "greenlight-kotlin"
3840

3941
- name: Install Protoc
4042
uses: arduino/setup-protoc@v3
@@ -60,7 +62,7 @@ jobs:
6062
run: ./gradlew :lib:publishToMavenLocal --console=plain
6163

6264
- name: Upload Kotlin build outputs
63-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@v7
6466
with:
6567
name: kotlin-outputs
6668
path: libs/gl-sdk-android/lib/build/outputs/

.github/workflows/build-napi.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
name: Build N-API - ${{ matrix.target }}
13+
name: Build N-API - ${{ matrix.host }} / ${{ matrix.target }}
1414
runs-on: ${{ matrix.host }}
1515
strategy:
1616
fail-fast: false
@@ -24,10 +24,6 @@ jobs:
2424
target: aarch64-unknown-linux-gnu
2525
strip: aarch64-linux-gnu-strip -x *.node
2626

27-
- host: macos-15-intel
28-
target: x86_64-apple-darwin
29-
strip: strip -x *.node
30-
3127
- host: macos-14
3228
target: aarch64-apple-darwin
3329
strip: strip -x *.node
@@ -41,12 +37,12 @@ jobs:
4137
working-directory: libs/gl-sdk-napi
4238

4339
steps:
44-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v6
4541
with:
4642
ref: ${{ inputs.ref }}
4743

4844
- name: Setup Node.js
49-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v6
5046
with:
5147
node-version: 20
5248
cache: npm
@@ -59,12 +55,13 @@ jobs:
5955

6056
- uses: Swatinem/rust-cache@v2
6157
with:
62-
key: napi-${{ matrix.target }}
58+
shared-key: "greenlight-${{ matrix.target }}"
6359

6460
- name: Install Protoc
6561
uses: arduino/setup-protoc@v3
6662
with:
6763
version: '23.2'
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
6865

6966
- name: Setup cross-compilation (Linux ARM64)
7067
if: matrix.target == 'aarch64-unknown-linux-gnu'
@@ -85,7 +82,7 @@ jobs:
8582
shell: bash
8683

8784
- name: Upload artifact
88-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@v7
8986
with:
9087
name: napi-${{ matrix.target }}
9188
path: |

.github/workflows/build-python.yml

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ jobs:
1313
name: Source Distribution
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
with:
1818
ref: ${{ inputs.ref }}
1919

20-
- uses: actions/setup-python@v5
20+
- uses: actions/setup-python@v6
2121
with:
2222
python-version: '3.10'
2323

2424
- name: Install uv
25-
uses: astral-sh/setup-uv@v7
25+
uses: astral-sh/setup-uv@v8.1.0
2626

2727
- name: Build source distribution
2828
run: uv build --package gl-client --sdist
2929

3030
- name: Upload source distribution
31-
uses: actions/upload-artifact@v4
31+
uses: actions/upload-artifact@v7
3232
with:
3333
name: python-sdist
3434
path: dist/gl_client-*.tar.gz
@@ -44,43 +44,54 @@ jobs:
4444
- host: ubuntu-latest
4545
os: linux
4646
target: x86_64
47+
architecture: x64
4748

4849
- host: ubuntu-latest
4950
os: linux
5051
target: i686
52+
architecture: x64
5153

52-
- host: macos-latest
53-
os: macos
54-
target: x86_64
55-
56-
- host: macos-latest
54+
- host: macos-14
5755
os: macos
5856
target: aarch64
57+
architecture: arm64
5958

6059
- host: windows-latest
6160
os: windows
6261
target: x64
62+
architecture: x64
6363

6464
- host: windows-latest
6565
os: windows
6666
target: x86
67+
architecture: x86
6768

6869
steps:
69-
- uses: actions/checkout@v4
70+
- uses: actions/checkout@v6
7071
with:
7172
ref: ${{ inputs.ref }}
7273

73-
- uses: actions/setup-python@v5
74+
- uses: actions/setup-python@v6
7475
with:
7576
python-version: '3.10'
77+
architecture: ${{ matrix.architecture }}
7678

7779
- name: Install uv
78-
uses: astral-sh/setup-uv@v7
80+
uses: astral-sh/setup-uv@v8.1.0
81+
82+
- name: Install Rust Toolchain
83+
uses: dtolnay/rust-toolchain@stable
84+
85+
- name: Rust Cache (Per Architecture)
86+
uses: Swatinem/rust-cache@v2
87+
with:
88+
shared-key: "greenlight-${{ matrix.target || 'host' }}"
7989

8090
- name: Install Protoc
8191
uses: arduino/setup-protoc@v3
8292
with:
8393
version: '23.2'
94+
repo-token: ${{ secrets.GITHUB_TOKEN }}
8495

8596
- name: Build wheels
8697
uses: PyO3/maturin-action@v1
@@ -94,8 +105,43 @@ jobs:
94105
docker-options: >-
95106
-v /opt/hostedtoolcache/protoc/v23.2/x64/bin/protoc:/usr/bin/protoc:ro
96107
108+
- name: Build gl-sdk shared library (64-bit only)
109+
if: matrix.target == 'x86_64' || matrix.target == 'aarch64' || matrix.target == 'x64'
110+
run: cargo build --release -p gl-sdk
111+
112+
- name: Build and retag gl-sdk wheel (64-bit only)
113+
if: matrix.target == 'x86_64' || matrix.target == 'aarch64' || matrix.target == 'x64'
114+
shell: bash
115+
run: |
116+
if [ "${{ matrix.os }}" = "macos" ]; then
117+
LIB_EXT="dylib"
118+
elif [ "${{ matrix.os }}" = "windows" ]; then
119+
LIB_EXT="dll"
120+
else
121+
LIB_EXT="so"
122+
fi
123+
mkdir -p libs/gl-sdk/glsdk
124+
LIB_PATH=$(find target -name "libglsdk.${LIB_EXT}" -o -name "glsdk.${LIB_EXT}" | head -n 1)
125+
install -m 0755 "${LIB_PATH}" libs/gl-sdk/glsdk/libglsdk.${LIB_EXT}
126+
if [ "${{ matrix.os }}" = "linux" ] && [ -d "libs/gl-client-py/dist" ]; then
127+
sudo chown -R $(id -u):$(id -g) libs/gl-client-py/dist
128+
fi
129+
uv build --package gl-sdk --wheel --out-dir libs/gl-client-py/dist
130+
# Retag: hatchling produces py3-none-any but the wheel contains a native shared lib
131+
pip install wheel
132+
if [ "${{ matrix.os }}" = "linux" ]; then
133+
PLAT="manylinux_2_17_${{ matrix.target }}"
134+
elif [ "${{ matrix.os }}" = "macos" ]; then
135+
PLAT="${{ matrix.target == 'aarch64' && 'macosx_11_0_arm64' || 'macosx_10_12_x86_64' }}"
136+
elif [ "${{ matrix.os }}" = "windows" ]; then
137+
PLAT="${{ matrix.target == 'x64' && 'win_amd64' || 'win32' }}"
138+
fi
139+
for whl in libs/gl-client-py/dist/gl_sdk*.whl; do
140+
python -m wheel tags --remove --platform-tag "$PLAT" "$whl"
141+
done
142+
97143
- name: Upload wheels
98-
uses: actions/upload-artifact@v4
144+
uses: actions/upload-artifact@v7
99145
with:
100146
name: python-wheel-${{ matrix.os }}-${{ matrix.target }}
101147
path: libs/gl-client-py/dist/

.github/workflows/build-rust.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ on:
1010

1111
jobs:
1212
build-and-test:
13-
name: Rust build and unit tests
13+
name: Rust build and unit tests (Linux)
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717
with:
1818
ref: ${{ inputs.ref }}
1919

2020
- uses: dtolnay/rust-toolchain@stable
2121

2222
- uses: Swatinem/rust-cache@v2
23+
with:
24+
shared-key: "greenlight-rust"
2325

2426
- name: Install Protoc
2527
uses: arduino/setup-protoc@v3
2628
with:
2729
version: '23.2'
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2831

2932
- name: Build workspace
3033
run: cargo build --workspace

.github/workflows/build-swift.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ on:
1414

1515
jobs:
1616
build:
17-
name: Build Swift XCFramework
17+
name: Build Swift XCFramework (macOS)
1818
runs-on: macos-15
1919
outputs:
2020
xcframework_checksum: ${{ steps.checksum.outputs.checksum }}
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v6
2323
with:
2424
submodules: true
2525
ref: ${{ inputs.ref }}
@@ -29,6 +29,8 @@ jobs:
2929
targets: x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim
3030

3131
- uses: Swatinem/rust-cache@v2
32+
with:
33+
shared-key: "greenlight-swift"
3234

3335
- name: Setup Task
3436
run: |
@@ -58,14 +60,14 @@ jobs:
5860
echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
5961
6062
- name: Upload XCFramework zip
61-
uses: actions/upload-artifact@v4
63+
uses: actions/upload-artifact@v7
6264
with:
6365
name: swift-xcframework
6466
path: target/glsdkFFI.xcframework.zip
6567
retention-days: 7
6668

6769
- name: Upload generated Swift source
68-
uses: actions/upload-artifact@v4
70+
uses: actions/upload-artifact@v7
6971
with:
7072
name: swift-generated-source
7173
path: target/swift/glsdk.swift
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Test Binaries
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: 'Git ref to check out and build'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build:
13+
name: Build gl-plugin and gl-signerproxy (Linux)
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
ref: ${{ inputs.ref }}
19+
20+
- uses: dtolnay/rust-toolchain@stable
21+
22+
- uses: Swatinem/rust-cache@v2
23+
with:
24+
shared-key: "greenlight-test-binaries"
25+
26+
- name: Install Protoc
27+
uses: arduino/setup-protoc@v3
28+
with:
29+
version: '23.2'
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build test binaries
33+
run: cargo build -p gl-plugin -p gl-signerproxy
34+
35+
- name: Upload test binaries
36+
uses: actions/upload-artifact@v7
37+
with:
38+
name: test-binaries-linux-x86_64
39+
path: |
40+
target/debug/gl-plugin
41+
target/debug/gl-signerproxy
42+
retention-days: 1

.github/workflows/check-self.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v6
2121

2222
- name: Install Task
2323
uses: arduino/setup-task@v2
2424
env:
2525
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626

2727
- name: Install the latest version of uv
28-
uses: astral-sh/setup-uv@v5
28+
uses: astral-sh/setup-uv@v8.1.0
2929
env:
3030
UV_PYTHON: 3.11
3131

0 commit comments

Comments
 (0)