File tree Expand file tree Collapse file tree 2 files changed +50
-5
lines changed
Expand file tree Collapse file tree 2 files changed +50
-5
lines changed Original file line number Diff line number Diff line change 4545 (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
4646 runs-on : ubuntu-24.04
4747 env :
48+ IS_PUSH : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
4849 IS_SCHEDULE_DISPATCH : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
4950 outputs :
5051 sdist_file : ${{ steps.save-path.outputs.sdist_name }}
@@ -117,6 +118,7 @@ jobs:
117118 python : ["cp313t", "3.13"]
118119
119120 env :
121+ IS_PUSH : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
120122 IS_SCHEDULE_DISPATCH : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
121123 steps :
122124 - name : Checkout pandas
@@ -202,11 +204,18 @@ jobs:
202204 path : ./wheelhouse/*.whl
203205
204206 - name : Upload wheels & sdist
205- if : ${{ success() && env.IS_SCHEDULE_DISPATCH == 'true' }}
206- uses :
scientific-python/[email protected] 207- with :
208- artifacts_path : dist
209- anaconda_nightly_upload_token : ${{secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN}}
207+ if : ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
208+ shell : bash -el {0}
209+ env :
210+ PANDAS_NIGHTLY_UPLOAD_TOKEN : ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
211+ # trigger an upload to
212+ # https://anaconda.org/scientific-python-nightly-wheels/pandas
213+ # for cron jobs or "Run workflow" (restricted to main branch).
214+ # The tokens were originally generated at anaconda.org
215+ run : |
216+ source ci/upload_wheels.sh
217+ set_upload_vars
218+ upload_wheels
210219
211220 publish :
212221 if : >
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh
3+
4+ set_upload_vars () {
5+ echo " IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH "
6+ if [[ " $IS_SCHEDULE_DISPATCH " == " true" ]]; then
7+ echo scheduled or dispatched event
8+ export ANACONDA_ORG=" scientific-python-nightly-wheels"
9+ export TOKEN=" $PANDAS_NIGHTLY_UPLOAD_TOKEN "
10+ export ANACONDA_UPLOAD=" true"
11+ else
12+ echo non-dispatch event
13+ export ANACONDA_UPLOAD=" false"
14+ fi
15+ }
16+ upload_wheels () {
17+ echo " ${PWD} "
18+ if [[ ${ANACONDA_UPLOAD} == true ]]; then
19+ if [ -z " ${TOKEN} " ]; then
20+ echo no token set, not uploading
21+ else
22+ # sdists are located under dist folder when built through setup.py
23+ if compgen -G " ./dist/*.gz" ; then
24+ echo " Found sdist"
25+ anaconda -q -t " ${TOKEN} " upload --skip -u " ${ANACONDA_ORG} " ./dist/* .gz
26+ echo " Uploaded sdist"
27+ fi
28+ if compgen -G " ./wheelhouse/*.whl" ; then
29+ echo " Found wheel"
30+ anaconda -q -t " ${TOKEN} " upload --skip -u " ${ANACONDA_ORG} " ./wheelhouse/* .whl
31+ echo " Uploaded wheel"
32+ fi
33+ echo " PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG /simple"
34+ fi
35+ fi
36+ }
You can’t perform that action at this time.
0 commit comments