1818
1919 runs-on : ${{ matrix.os }}
2020 steps :
21- - name : Debug workflow context
22- run : |
23- echo "GITHUB_WORKFLOW_REF=$GITHUB_WORKFLOW_REF"
24- echo "GITHUB_WORKFLOW_SHA=$GITHUB_WORKFLOW_SHA"
25- echo "GITHUB_REF=$GITHUB_REF"
26- echo "GITHUB_SHA=$GITHUB_SHA"
2721 - uses : actions/checkout@v4
2822
2923 - name : Install uv
3933 python -m pip install tomli
4034 python hooks/version_check.py
4135
42- - name : Install dependencies
36+ - name : Install build tooling
4337 run : |
44- cp dist/pyballistic-exts-[0-9]* dist-exts/ 2>/dev/null || true
4538 python -m pip install build cibuildwheel
4639
4740 - name : Build pure python package
5346 python -m build --sdist --outdir ../dist
5447 cibuildwheel --output-dir ../dist
5548 cd ..
56- echo "Exts patterns:" && ls -la dist/pyballistic.exts-[0-9]* dist/pyballistic-exts-[0-9]* dist/pyballistic_exts-*.whl 2>/dev/null || true
49+
5750 - name : List ./dist
5851 run : ls ./dist
5952
@@ -66,61 +59,57 @@ jobs:
6659 publish :
6760 needs : build
6861 runs-on : ubuntu-latest
62+ environment : pypi
63+ permissions :
64+ id-token : write
65+ steps :
66+ - name : Download artifacts (Ubuntu)
67+ uses : actions/download-artifact@v4
68+ with :
69+ name : dist-ubuntu-latest
70+ path : ./dist-ubuntu
6971
70- - name : Publish all distributions (pyballistic + exts )
71- uses : pypa/gh-action-pypi-publish@release/v1
72+ - name : Download artifacts (Windows )
73+ uses : actions/download-artifact@v4
7274 with :
73- packages-dir : dist
74- skip-existing : true
75- cp ./dist-ubuntu/* dist/ || true
76- cp ./dist-windows/* dist/ || true
77- cp ./dist-macos-13/* dist/ || true
78- cp ./dist-macos-14/* dist/ || true
79- echo "Combined dists:" && ls -la dist || true
80- # Fail fast if nothing combined
81- if [ -z "$(ls -A dist 2>/dev/null)" ]; then
82- echo "No distributions found in combined dist folder" >&2
83- exit 1
84- fi
75+ name : dist-windows-latest
76+ path : ./dist-windows
8577
86- - name : List ./dist
87- run : ls ./dist
78+ - name : Download artifacts (macOS 13)
79+ uses : actions/download-artifact@v4
80+ with :
81+ name : dist-macos-13
82+ path : ./dist-macos-13
8883
89- - name : Split dists for core and exts
84+ - name : Download artifacts (macOS 14)
85+ uses : actions/download-artifact@v4
86+ with :
87+ name : dist-macos-14
88+ path : ./dist-macos-14
89+
90+ - name : Inspect downloaded artifacts
91+ run : |
92+ echo "Ubuntu:" && ls -la ./dist-ubuntu || true
93+ echo "Windows:" && ls -la ./dist-windows || true
94+ echo "macOS 13:" && ls -la ./dist-macos-13 || true
95+ echo "macOS 14:" && ls -la ./dist-macos-14 || true
96+
97+ - name : Combine artifacts
9098 shell : bash
9199 run : |
92- set -e
93- mkdir -p dist-core dist-exts
94- echo "Splitting combined dists..."
95- echo "Combined dist contents:" && ls -la dist || true
96- # Copy core (handles sdist and wheels)
97- cp dist/pyballistic-[0-9]* dist-core/ 2>/dev/null || true
98- cp dist/pyballistic-*.whl dist-core/ 2>/dev/null || true
99- # Copy exts: dot and underscore package names (sdist + wheels)
100- cp dist/pyballistic.exts-[0-9]* dist-exts/ 2>/dev/null || true
101- cp dist/pyballistic_exts-*.whl dist-exts/ 2>/dev/null || true
102- echo "Core dists:" && ls -la dist-core || true
103- echo "Exts dists:" && ls -la dist-exts || true
104- # Sanity checks with helpful debug
105- if [ -z "$(ls -A dist-core 2>/dev/null)" ]; then
106- echo "No core distributions were found after split" >&2
107- echo "Core patterns:" && ls -la dist/pyballistic-[0-9]* dist/pyballistic-*.whl 2>/dev/null || true
108- exit 1
109- fi
110- if [ -z "$(ls -A dist-exts 2>/dev/null)" ]; then
111- echo "No extensions distributions were found after split" >&2
112- echo "Exts patterns:" && ls -la dist/pyballistic.exts-[0-9]* dist/pyballistic_exts-*.whl 2>/dev/null || true
100+ mkdir -p dist
101+ cp ./dist-ubuntu/* dist/ 2>/dev/null || true
102+ cp ./dist-windows/* dist/ 2>/dev/null || true
103+ cp ./dist-macos-13/* dist/ 2>/dev/null || true
104+ cp ./dist-macos-14/* dist/ 2>/dev/null || true
105+ echo "Combined dists:" && ls -la dist || true
106+ if [ -z "$(ls -A dist 2>/dev/null)" ]; then
107+ echo "No distributions found in combined dist folder" >&2
113108 exit 1
114109 fi
115110
116- - name : Publish core package (pyballistic)
117- uses : pypa/gh-action-pypi-publish@release/v1
118- with :
119- packages-dir : dist-core
120- skip-existing : true
121-
122- - name : Publish extensions package (pyballistic.exts)
111+ - name : Publish all distributions (pyballistic + exts)
123112 uses : pypa/gh-action-pypi-publish@release/v1
124113 with :
125- packages-dir : dist-exts
114+ packages-dir : dist
126115 skip-existing : true
0 commit comments