diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 39c5a9e1a992d..fca1a856ba35b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -45,7 +45,6 @@ jobs: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) runs-on: ubuntu-24.04 env: - IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} outputs: sdist_file: ${{ steps.save-path.outputs.sdist_name }} @@ -118,7 +117,6 @@ jobs: python: ["cp313t", "3.13"] env: - IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} steps: - name: Checkout pandas @@ -204,18 +202,11 @@ jobs: path: ./wheelhouse/*.whl - name: Upload wheels & sdist - if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }} - shell: bash -el {0} - env: - PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }} - # trigger an upload to - # https://anaconda.org/scientific-python-nightly-wheels/pandas - # for cron jobs or "Run workflow" (restricted to main branch). - # The tokens were originally generated at anaconda.org - run: | - source ci/upload_wheels.sh - set_upload_vars - upload_wheels + if: ${{ success() && env.IS_SCHEDULE_DISPATCH == 'true' }} + uses: scientific-python/upload-nightly-action@0.6.2 + with: + artifacts_path: dist + anaconda_nightly_upload_token: ${{secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN}} publish: if: > diff --git a/ci/upload_wheels.sh b/ci/upload_wheels.sh deleted file mode 100644 index 92959e8716a80..0000000000000 --- a/ci/upload_wheels.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh - -set_upload_vars() { - echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH" - if [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then - echo scheduled or dispatched event - export ANACONDA_ORG="scientific-python-nightly-wheels" - export TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN" - export ANACONDA_UPLOAD="true" - else - echo non-dispatch event - export ANACONDA_UPLOAD="false" - fi -} -upload_wheels() { - echo "${PWD}" - if [[ ${ANACONDA_UPLOAD} == true ]]; then - if [ -z "${TOKEN}" ]; then - echo no token set, not uploading - else - # sdists are located under dist folder when built through setup.py - if compgen -G "./dist/*.gz"; then - echo "Found sdist" - anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./dist/*.gz - echo "Uploaded sdist" - fi - if compgen -G "./wheelhouse/*.whl"; then - echo "Found wheel" - anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./wheelhouse/*.whl - echo "Uploaded wheel" - fi - echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple" - fi - fi -}