Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbutlerboudakiankce committed Jan 25, 2024
1 parent d928a5c commit bdae818
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 42 deletions.
34 changes: 4 additions & 30 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
name: Wheel builder

on:
schedule:
# 3:27 UTC every day
- cron: "27 3 * * *"
push:
branches:
- 1.5.x
pull_request:
types: [labeled, opened, synchronize, reopened]
paths-ignore:
Expand All @@ -34,12 +33,6 @@ permissions:
jobs:
build_sdist:
name: Build sdist
if: >-
(github.event_name == 'schedule') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ubuntu-22.04
env:
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
Expand Down Expand Up @@ -79,12 +72,6 @@ jobs:
build_wheels:
needs: build_sdist
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
if: >-
(github.event_name == 'schedule') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -146,18 +133,6 @@ jobs:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

- name: Build nightly wheels (with NumPy pre-release)
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
uses: pypa/[email protected]
with:
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
# The nightly wheels should be build witht he NumPy 2.0 pre-releases
# which requires the additional URL.
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

- name: Set up Python
uses: mamba-org/setup-micromamba@v1
with:
Expand Down Expand Up @@ -199,14 +174,13 @@ jobs:
shell: bash -el {0}
env:
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
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).
# Tags will upload to
# https://anaconda.org/multibuild-wheels-staging/pandas
# The tokens were originally generated at anaconda.org
run: |
source ci/upload_wheels.sh
python -m pip install -U pip
set_upload_vars
upload_wheels
upload_wheels
15 changes: 3 additions & 12 deletions ci/upload_wheels.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh

set_upload_vars() {
echo "IS_PUSH is $IS_PUSH"
echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH"
if [[ "$IS_PUSH" == "true" ]]; then
echo push and tag event
export ANACONDA_ORG="multibuild-wheels-staging"
export TOKEN="$PANDAS_STAGING_UPLOAD_TOKEN"
export ANACONDA_UPLOAD="true"
elif [[ "$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"
Expand All @@ -27,15 +19,14 @@ upload_wheels() {
# 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
twine upload -r https://pkgs.dev.azure.com/key-capture-energy/_packaging/kce/pypi/upload/ -u . -p ${TOKEN} ./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
twine upload -r https://pkgs.dev.azure.com/key-capture-energy/_packaging/kce/pypi/upload/ -u . -p ${TOKEN} ./wheelhouse/*.whl
echo "Uploaded wheel"
fi
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
fi
fi
}
}

0 comments on commit bdae818

Please sign in to comment.