3232 - ' https://upload.pypi.org/legacy/'
3333 - ' https://test.pypi.org/legacy/'
3434 default : ' https://test.pypi.org/legacy/'
35+ # -------------------------------------------------------------------------
36+ # Platform override inputs for workflow_dispatch (one-off builds)
37+ # These override the env defaults below when manually triggering the workflow
38+ # -------------------------------------------------------------------------
39+ enable_linux_arm64 :
40+ description : ' Enable Linux ARM64 (Ubuntu) builds'
41+ type : boolean
42+ default : true
43+ enable_linux_x86_64 :
44+ description : ' Enable Linux x86_64 (Ubuntu) builds'
45+ type : boolean
46+ default : true
47+ enable_alpine_arm64 :
48+ description : ' Enable Alpine ARM64 (musl) builds'
49+ type : boolean
50+ default : true
51+ enable_alpine_x86_64 :
52+ description : ' Enable Alpine x86_64 (musl) builds'
53+ type : boolean
54+ default : true
55+ enable_macos_arm64 :
56+ description : ' Enable macOS ARM64 (Apple Silicon) builds'
57+ type : boolean
58+ default : true
59+ enable_macos_x86_64 :
60+ description : ' Enable macOS x86_64 (Intel) builds'
61+ type : boolean
62+ default : true
63+ enable_windows_x86_64 :
64+ description : ' Enable Windows x86_64 builds (may have wheel corruption issues)'
65+ type : boolean
66+ default : false
3567# pull_request:
3668# branches: [ main ]
3769
70+ # ==============================================================================
71+ # PLATFORM SUPPORT FLAGS
72+ # ==============================================================================
73+ # Toggle platform builds by setting these to 'true' or 'false'.
74+ # For one-off builds with different settings, use workflow_dispatch inputs.
75+ #
76+ # Current status:
77+ # - Linux ARM64: ENABLED (native ubuntu-24.04-arm runner)
78+ # - Linux x86_64: ENABLED (native ubuntu-latest runner)
79+ # - Alpine ARM64: ENABLED (musl cross-compile on ARM64 runner)
80+ # - Alpine x86_64: ENABLED (musl cross-compile on x86_64 runner)
81+ # - macOS ARM64: ENABLED (native macos-14 Apple Silicon runner)
82+ # - macOS x86_64: ENABLED (cross-compile on macos-14)
83+ # - Windows x86_64: DISABLED (wheel corruption issue - see TODO below)
84+ #
85+ # TODO(handlebarrz): Re-enable Windows support once wheel corruption issue is fixed.
86+ # Issue: PyPI upload fails with "400 Invalid distribution file. ZIP archive not
87+ # accepted: Mis-matched data size" for Windows wheels.
88+ # ==============================================================================
89+ env :
90+ # Linux platforms
91+ ENABLE_LINUX_ARM64 : ' true'
92+ ENABLE_LINUX_X86_64 : ' true'
93+ # Alpine (musl) platforms
94+ ENABLE_ALPINE_ARM64 : ' true'
95+ ENABLE_ALPINE_X86_64 : ' true'
96+ # macOS platforms
97+ ENABLE_MACOS_ARM64 : ' true'
98+ ENABLE_MACOS_X86_64 : ' true'
99+ # Windows platforms (currently disabled due to wheel corruption)
100+ ENABLE_WINDOWS_X86_64 : ' false'
101+
38102
39103jobs :
104+ # ===========================================================================
105+ # BUILD JOBS
106+ # ===========================================================================
107+
40108 build_ubuntu_arm64 :
41109 name : Build for Ubuntu ARM64
42110 runs-on : ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed
43- # Triggers on GitHub releases for the 'dotpromptz-handlebars' package (tag: dotpromptz-handlebars-X.Y.Z)
44- if : github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dotpromptz-handlebars-'))
111+ if : |
112+ (env.ENABLE_LINUX_ARM64 == 'true' || inputs.enable_linux_arm64 == true) &&
113+ (github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'dotpromptz-handlebars-')))
45114 strategy :
46115 matrix :
47116 python_version :
89158 build_alpine_arm64 :
90159 name : Build for Alpine ARM64
91160 runs-on : ubuntu-24.04-arm # Native ARM64 runner - cross-compile for musl
161+ if : env.ENABLE_ALPINE_ARM64 == 'true' || inputs.enable_alpine_arm64 == true
92162 strategy :
93163 matrix :
94164 python_version :
@@ -137,6 +207,7 @@ jobs:
137207 build_alpine_x86_64 :
138208 name : Build for Alpine x86_64
139209 runs-on : ubuntu-latest # Native x86_64 runner - cross-compile for musl
210+ if : env.ENABLE_ALPINE_X86_64 == 'true' || inputs.enable_alpine_x86_64 == true
140211 strategy :
141212 matrix :
142213 python_version :
@@ -185,6 +256,7 @@ jobs:
185256 build_ubuntu_x86_64 :
186257 name : Build for Ubuntu x86_64
187258 runs-on : ubuntu-latest # Native x86_64 runner
259+ if : env.ENABLE_LINUX_X86_64 == 'true' || inputs.enable_linux_x86_64 == true
188260 strategy :
189261 matrix :
190262 python_version :
@@ -233,6 +305,8 @@ jobs:
233305 build_windows_x86_64 :
234306 name : Build for Windows x86_64
235307 runs-on : windows-latest
308+ # Currently disabled due to wheel corruption issues - see env flags above
309+ if : env.ENABLE_WINDOWS_X86_64 == 'true' || inputs.enable_windows_x86_64 == true
236310 strategy :
237311 matrix :
238312 python_version :
@@ -269,10 +343,11 @@ jobs:
269343 with :
270344 name : wheels-windows-x86_64-${{ matrix.python_version }}
271345 path : python/handlebarrz/dist
272- #
346+
273347 build_macos_arm64 :
274348 name : Build for macOS ARM64
275349 runs-on : macos-14 # Apple Silicon
350+ if : env.ENABLE_MACOS_ARM64 == 'true' || inputs.enable_macos_arm64 == true
276351 strategy :
277352 matrix :
278353 python_version :
@@ -321,6 +396,7 @@ jobs:
321396 build_macos_x86_64 :
322397 name : Build for macOS x86_64
323398 runs-on : macos-14
399+ if : env.ENABLE_MACOS_X86_64 == 'true' || inputs.enable_macos_x86_64 == true
324400 strategy :
325401 matrix :
326402 python_version :
@@ -404,9 +480,18 @@ jobs:
404480# name: wheels-windows-arm64-${{ matrix.python_version }}
405481# path: python/handlebarrz/dist
406482
483+ # ===========================================================================
484+ # PUBLISH JOB
485+ # ===========================================================================
486+
407487 pypi_publish :
408488 name : Upload to PyPI by python version
409- needs : [build_ubuntu_arm64,build_ubuntu_x86_64,build_alpine_arm64,build_alpine_x86_64,build_windows_x86_64,build_macos_arm64,build_macos_x86_64]
489+ # NOTE: Jobs with conditional 'if' statements are not listed in 'needs' because
490+ # GitHub Actions would fail if a skipped job is in the needs list.
491+ # Artifacts from all enabled platforms are collected via download-artifact's merge-multiple.
492+ # This job runs if at least one build job completes (using always() + success check).
493+ needs : [build_ubuntu_arm64,build_ubuntu_x86_64,build_alpine_arm64,build_alpine_x86_64,build_macos_arm64,build_macos_x86_64]
494+ if : always() && !cancelled() && (needs.build_ubuntu_arm64.result == 'success' || needs.build_ubuntu_x86_64.result == 'success' || needs.build_alpine_arm64.result == 'success' || needs.build_alpine_x86_64.result == 'success' || needs.build_macos_arm64.result == 'success' || needs.build_macos_x86_64.result == 'success')
410495 runs-on : ubuntu-latest
411496 environment :
412497 name : pypi_github_publishing
@@ -437,10 +522,15 @@ jobs:
437522 - name : Sleep for pypi server to load
438523 run : sleep 180
439524
525+ # ===========================================================================
526+ # SMOKE TEST JOBS
527+ # ===========================================================================
528+
440529 smoke_test_linux_arm64 :
441530 name : Test for Linux ARM64
442531 needs : [pypi_publish]
443532 runs-on : ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed
533+ if : env.ENABLE_LINUX_ARM64 == 'true' || inputs.enable_linux_arm64 == true
444534 strategy :
445535 matrix :
446536 python_version :
@@ -471,6 +561,7 @@ jobs:
471561 name : Test for Alpine ARM64
472562 needs : [pypi_publish]
473563 runs-on : ubuntu-24.04-arm # Native ARM64 runner - no QEMU needed
564+ if : env.ENABLE_ALPINE_ARM64 == 'true' || inputs.enable_alpine_arm64 == true
474565 strategy :
475566 matrix :
476567 python_version :
@@ -498,6 +589,7 @@ jobs:
498589 name : Test for Alpine x86_64
499590 needs : [pypi_publish]
500591 runs-on : ubuntu-latest # Native x86_64 - no QEMU needed
592+ if : env.ENABLE_ALPINE_X86_64 == 'true' || inputs.enable_alpine_x86_64 == true
501593 strategy :
502594 matrix :
503595 python_version :
@@ -525,6 +617,7 @@ jobs:
525617 name : Test for Linux x86_64
526618 needs : [pypi_publish]
527619 runs-on : ubuntu-latest
620+ if : env.ENABLE_LINUX_X86_64 == 'true' || inputs.enable_linux_x86_64 == true
528621 strategy :
529622 matrix :
530623 python_version :
@@ -556,6 +649,7 @@ jobs:
556649 name : Test for macOS ARM64
557650 needs : [pypi_publish]
558651 runs-on : macos-14
652+ if : env.ENABLE_MACOS_ARM64 == 'true' || inputs.enable_macos_arm64 == true
559653 strategy :
560654 matrix :
561655 python_version :
@@ -581,8 +675,9 @@ jobs:
581675
582676 smoke_test_macos_x86_64 :
583677 name : Test for macOS x86_64
584- needs : [ pypi_publish ]
678+ needs : [pypi_publish]
585679 runs-on : macos-14
680+ if : env.ENABLE_MACOS_X86_64 == 'true' || inputs.enable_macos_x86_64 == true
586681 strategy :
587682 matrix :
588683 python_version :
@@ -612,6 +707,8 @@ jobs:
612707 name : Test for Windows x86_64
613708 needs : [pypi_publish]
614709 runs-on : windows-latest
710+ # Currently disabled due to wheel corruption issues - see env flags above
711+ if : env.ENABLE_WINDOWS_X86_64 == 'true' || inputs.enable_windows_x86_64 == true
615712 strategy :
616713 matrix :
617714 python_version :
0 commit comments