3939 exit 1
4040 fi
4141
42- # Check if staging is ahead of master
43- git fetch origin master
44- AHEAD=$(git rev-list --count origin/master..staging)
45- if [ "$AHEAD" -eq "0" ]; then
46- echo "❌ Staging branch has no commits ahead of master"
47- exit 1
48- fi
49-
50- echo "✅ Staging is $AHEAD commits ahead of master"
51-
5242 - name : Check version from staging validation
5343 id : get-version
5444 run : |
@@ -138,6 +128,43 @@ jobs:
138128 with :
139129 ref : master
140130
131+ - name : Download artifacts from Staging Release Workflow
132+ id : download-artifacts
133+ uses : dawidd6/action-download-artifact@v11
134+ with :
135+ workflow : staging-release.yml
136+ workflow_conclusion : success
137+ name : binaries-.*
138+ name_is_regexp : true
139+ path : pyfunnel/lib/
140+ merge-multiple : true
141+
142+ - name : Flatten artifact structure
143+ run : |
144+ # Move files from nested directories to target structure
145+ find pyfunnel/lib/binaries-* -type f -exec sh -c '
146+ for file; do
147+ # Extract the platform directory (darwin64, linux64, win64)
148+ platform_dir=$(dirname "$file" | sed "s/.*binaries-[^/]*\///")
149+ target_dir="pyfunnel/lib/$platform_dir"
150+ mkdir -p "$target_dir"
151+ mv "$file" "$target_dir/"
152+ done
153+ ' _ {} +
154+
155+ # Clean up empty artifact directories
156+ rm -rf pyfunnel/lib/binaries-*
157+
158+ - name : Check for binaries
159+ run : |
160+ if [ -d "pyfunnel/lib" ] && [ "$(ls -A pyfunnel/lib)" ]; then
161+ echo "✅ Binaries found in pyfunnel/lib"
162+ ls -la pyfunnel/lib/
163+ else
164+ echo "❌ No binaries found in pyfunnel/lib"
165+ exit 1
166+ fi
167+
141168 - name : Extract release notes from changelog
142169 id : release_notes
143170 run : |
@@ -156,25 +183,35 @@ jobs:
156183 - name : Install build dependencies
157184 run : |
158185 python -m pip install --upgrade pip
159- python -m pip install build twine
186+ python -m pip install --upgrade build twine setuptools wheel
160187
161188 - name : Build package
162- run : python -m build --sdist --wheel .
163-
164- - name : Create GH Release
165- env :
166- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
167- run : | # The following will create the git tag.
168- gh release create "${{ needs.validate-staging.outputs.release-tag }}" dist/* \
169- --title "${{ needs.validate-staging.outputs.release-tag }}" \
170- --notes "${{ steps.release_notes.outputs.content }}"
171-
172- - name : Publish to PyPI
173- env :
174- TWINE_USERNAME : __token__
175- TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
176189 run : |
177- python -m twine upload dist/*
190+ # Clean any previous builds
191+ rm -rf dist/ build/ *.egg-info/
192+ # Build
193+ python -m build --sdist --wheel .
194+ # Verify the built packages
195+ echo "Built packages:"
196+ ls -la dist/
197+ # Check wheel contents
198+ python -m zipfile -l dist/*.whl | head -30
199+ python -m twine check dist/*
200+
201+ # - name: Create GH Release
202+ # env:
203+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
204+ # run: | # The following will create the git tag.
205+ # gh release create "${{ needs.validate-staging.outputs.release-tag }}" dist/* \
206+ # --title "${{ needs.validate-staging.outputs.release-tag }}" \
207+ # --notes "${{ steps.release_notes.outputs.content }}"
208+
209+ # - name: Publish to PyPI
210+ # env:
211+ # TWINE_USERNAME: __token__
212+ # TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
213+ # run: |
214+ # python -m twine upload dist/*
178215
179216 notify-completion :
180217 needs : [validate-staging, merge-to-master, publish-release]
0 commit comments