Skip to content

CI: add a nightly wheel upload #2213

CI: add a nightly wheel upload

CI: add a nightly wheel upload #2213

Workflow file for this run

name: Wheels
on:
push:
pull_request:
schedule:
# Run at 2:00 AM UTC daily
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is an arm64 runner
os: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
env:
CIBW_TEST_COMMAND: python -c "import numcodecs"
CIBW_BUILD: "cp311-* cp312-* cp313-*"
CIBW_SKIP: "pp* *-musllinux_* *win32 *_i686 *_s390x"
# note: CIBW_ENVIRONMENT is now set in pyproject.toml
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.11"
- name: Build sdist
run: pipx run build --sdist
- name: test install
run: pip install dist/numcodecs*.tar.gz
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
test_dist_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: test
run: |
ls
ls dist
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
upload_nightly:
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Upload to scientific-python nightly channel
uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY_UPLOAD_TOKEN }}