Skip to content

Commit a23f3a9

Browse files
committed
ci: split Linux build job into separate AMD64 and ARM64 workflows
1 parent 9cc2f51 commit a23f3a9

File tree

1 file changed

+36
-37
lines changed

1 file changed

+36
-37
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
path: .build/apple/Products/Release/subtree
3131
retention-days: 5
3232

33-
linux:
34-
name: Build Linux binaries
33+
linux-amd64:
34+
name: Build Linux AMD64 binary
3535
runs-on: ubuntu-latest
3636
steps:
3737
- name: Checkout
@@ -40,64 +40,63 @@ jobs:
4040
- name: Set up Docker Buildx
4141
uses: docker/setup-buildx-action@v3
4242

43-
- name: Install cross-binutils for aarch64
44-
run: sudo apt install -y binutils-aarch64-linux-gnu
45-
46-
- name: Build and export binaries
43+
- name: Build AMD64 binary
4744
uses: docker/build-push-action@v5
4845
with:
4946
context: .
50-
platforms: linux/amd64,linux/arm64
47+
platforms: linux/amd64
5148
target: output
5249
outputs: type=local,dest=artifacts
5350

54-
- name: Test and organize binaries
51+
- name: Strip and prepare binary
5552
run: |
56-
# Test that binaries were built successfully
57-
echo "✅ Linux AMD64 binary built: $(file artifacts/linux_amd64/subtree)"
58-
echo "✅ Linux ARM64 binary built: $(file artifacts/linux_arm64/subtree)"
59-
60-
# Verify architectures match expected platforms
61-
if ! file artifacts/linux_amd64/subtree | grep -q "x86.64\|x86_64"; then
62-
echo "❌ ERROR: AMD64 binary has wrong architecture!"
63-
echo "Expected: x86_64, Got: $(file artifacts/linux_amd64/subtree)"
64-
exit 1
65-
fi
66-
67-
if ! file artifacts/linux_arm64/subtree | grep -q "aarch64\|ARM aarch64"; then
68-
echo "❌ ERROR: ARM64 binary has wrong architecture!"
69-
echo "Expected: aarch64, Got: $(file artifacts/linux_arm64/subtree)"
70-
exit 1
71-
fi
72-
73-
echo "✅ Architecture verification passed"
74-
75-
# Strip and organize AMD64 binary
76-
strip artifacts/linux_amd64/subtree
77-
mv artifacts/linux_amd64/subtree "${HOME}/subtree_linux"
78-
79-
# Strip and organize ARM64 binary
80-
aarch64-linux-gnu-strip artifacts/linux_arm64/subtree
81-
mv artifacts/linux_arm64/subtree "${HOME}/subtree_linux_aarch64"
53+
strip artifacts/subtree
54+
mv artifacts/subtree subtree_linux
8255
8356
- name: Upload AMD64 Artifact
8457
uses: actions/upload-artifact@v4
8558
with:
8659
name: subtree_linux
87-
path: ~/subtree_linux
60+
path: subtree_linux
8861
retention-days: 5
62+
63+
linux-arm64:
64+
name: Build Linux ARM64 binary
65+
runs-on: ubuntu-24.04-arm64
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Set up Docker Buildx
71+
uses: docker/setup-buildx-action@v3
72+
73+
- name: Install ARM64 cross-tools
74+
run: sudo apt install -y binutils-aarch64-linux-gnu
75+
76+
- name: Build ARM64 binary
77+
uses: docker/build-push-action@v5
78+
with:
79+
context: .
80+
platforms: linux/arm64
81+
target: output
82+
outputs: type=local,dest=artifacts
83+
84+
- name: Strip and prepare binary
85+
run: |
86+
aarch64-linux-gnu-strip artifacts/subtree
87+
mv artifacts/subtree subtree_linux_aarch64
8988
9089
- name: Upload ARM64 Artifact
9190
uses: actions/upload-artifact@v4
9291
with:
9392
name: subtree_linux_aarch64
94-
path: ~/subtree_linux_aarch64
93+
path: subtree_linux_aarch64
9594
retention-days: 5
9695

9796
upload:
9897
name: Upload release artifacts
9998
runs-on: ubuntu-latest
100-
needs: [macos, linux]
99+
needs: [macos, linux-amd64, linux-arm64]
101100
steps:
102101
- name: Checkout the repository
103102
uses: actions/checkout@v4

0 commit comments

Comments
 (0)