Skip to content

Commit e60d1c5

Browse files
committed
Refactor build workflow to enhance Linux architecture handling and improve node organization
1 parent 35493f6 commit e60d1c5

1 file changed

Lines changed: 95 additions & 14 deletions

File tree

.github/workflows/graphs/build-test-publish.act

Lines changed: 95 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ nodes:
88
- id: gh-actions-setup-go-shark-pineapple-lemon
99
type: github.com/actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
1010
position:
11-
x: -1710
12-
y: 2710
11+
x: -1720
12+
y: 2550
1313
inputs:
1414
go-version: '1.25'
1515
token: ${{ github.token }}
@@ -31,11 +31,50 @@ nodes:
3131
- id: string-array-v1-pink-koala-zebra
3232
type: core/string-array@v1
3333
position:
34-
x: -1640
35-
y: 3470
34+
x: -1980
35+
y: 3380
3636
inputs:
3737
inputs[0]: arm64
3838
inputs[1]: x64
39+
- id: string-array-v1-linux-x64-only
40+
type: core/string-array@v1
41+
position:
42+
x: -2000
43+
y: 3680
44+
inputs:
45+
inputs[0]: x64
46+
- id: string-array-v1-linux-arm64-only
47+
type: core/string-array@v1
48+
position:
49+
x: -2000
50+
y: 3750
51+
inputs:
52+
inputs[0]: arm64
53+
- id: system-v1-arch-array-helper
54+
type: core/system-info@v1
55+
position:
56+
x: -1810
57+
y: 3900
58+
- id: select-data-v1-linux-native-arch
59+
type: core/select-data@v1
60+
position:
61+
x: -1610
62+
y: 3560
63+
inputs:
64+
choices[0]: null
65+
choices[1]: null
66+
comment: Picks native arch array on Linux (x64 or arm64) based on arch_index
67+
- id: select-data-v1-arch-array-for-platform
68+
type: core/select-data@v1
69+
position:
70+
x: -1400
71+
y: 3280
72+
inputs:
73+
choices[0]: null
74+
choices[1]: null
75+
comment: >-
76+
Non-Linux (index 0) gets full [arm64, x64] array; Linux (index 1) gets
77+
native-arch-only array
3978
- id: gh-actions-setup-python-panda-pomegranate-coconut
4079
type: github.com/actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
4180
position:
@@ -106,7 +145,8 @@ nodes:
106145
fi
107146

108147

109-
# On Linux, each arch has its own native runner, so skip non-native arch builds.
148+
# On Linux, each arch has its own native runner, so skip non-native arch
149+
builds.
110150

111151
if [[ "$CURRENT_OS" == "linux" && "$ARCH" != "$CURRENT_ARCH" ]]; then
112152
echo "Skipping $CURRENT_OS-$ARCH build on $CURRENT_ARCH runner (native runner handles this)."
@@ -263,8 +303,8 @@ nodes:
263303
- id: wait-for-v1-ivory-turkey-grapefruit
264304
type: core/wait-for@v1
265305
position:
266-
x: -2010
267-
y: 3090
306+
x: -2070
307+
y: 3000
268308
inputs:
269309
after: 2
270310
- id: run-v1-indigo-grape-gray
@@ -736,16 +776,20 @@ nodes:
736776
x: 6450
737777
y: 1430
738778
inputs:
739-
script: |
779+
script: >
740780
mkdir -p "$DIST_NEW"
741781

742-
# On Linux, skip splitting for non-native arch (not built on this runner).
782+
783+
# On Linux, skip splitting for non-native arch (not built on this
784+
runner).
785+
743786
if [[ "$OS" == "linux" && "$ARCH" != "$CURRENT_ARCH" ]]; then
744787
echo "Skipping split for $OS-$ARCH on $CURRENT_ARCH runner."
745788
exit 0
746789
fi
747790

748791

792+
749793
if [[ "$TARGET_TYPE" == "cli" ]]; then
750794
if [[ "$OS" == "linux" || "$OS" == "macos" ]]; then
751795
# Copy files with matching $ARCH and no suffix on linux and macos
@@ -773,6 +817,7 @@ nodes:
773817
exit 1
774818
fi
775819

820+
776821
echo "Splitting $BUILD_DIR into $DIST_NEW done"
777822
comment: split dist/ into dist_cli_*/ and dist_py_*/
778823
- id: run-v1-octopus-navy-passionfruit
@@ -6078,9 +6123,9 @@ nodes:
60786123
docker buildx create --use
60796124

60806125

6081-
# Build and push a single-arch image tagged with the arch suffix.
6082-
# The multi-arch manifest is created by a separate workflow job
6083-
# after both Linux runners complete.
6126+
# Build and push a single-arch image tagged with the arch suffix. # The
6127+
multi-arch manifest is created by a separate workflow job # after both
6128+
Linux runners complete.
60846129

60856130
docker buildx build \
60866131
--platform "$PLATFORM" \
@@ -6126,15 +6171,51 @@ connections:
61266171
dst:
61276172
node: select-data-v1-shark-crab-navy
61286173
port: choices[1]
6174+
- src:
6175+
node: string-array-v1-linux-x64-only
6176+
port: array
6177+
dst:
6178+
node: select-data-v1-linux-native-arch
6179+
port: choices[0]
6180+
- src:
6181+
node: string-array-v1-linux-arm64-only
6182+
port: array
6183+
dst:
6184+
node: select-data-v1-linux-native-arch
6185+
port: choices[1]
6186+
- src:
6187+
node: system-v1-arch-array-helper
6188+
port: arch_index
6189+
dst:
6190+
node: select-data-v1-linux-native-arch
6191+
port: index
61296192
- src:
61306193
node: string-array-v1-pink-koala-zebra
61316194
port: array
6195+
dst:
6196+
node: select-data-v1-arch-array-for-platform
6197+
port: choices[0]
6198+
- src:
6199+
node: select-data-v1-linux-native-arch
6200+
port: value
6201+
dst:
6202+
node: select-data-v1-arch-array-for-platform
6203+
port: choices[1]
6204+
- src:
6205+
node: system-v1-arch-array-helper
6206+
port: is_linux
6207+
dst:
6208+
node: select-data-v1-arch-array-for-platform
6209+
port: index
6210+
- src:
6211+
node: select-data-v1-arch-array-for-platform
6212+
port: value
61326213
dst:
61336214
node: concurrent-for-each-loop-v1-starfish-white-whale
61346215
port: input
61356216
- src:
6136-
node: string-array-v1-pink-koala-zebra
6137-
port: array
6217+
node: select-data-v1-arch-array-for-platform
6218+
port: value
61386219
dst:
61396220
node: length-v1-nectarine-squirrel-peacock
61406221
port: input

0 commit comments

Comments
 (0)