summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorThomas Li <47963215+lithomas1@users.noreply.github.com>2022-02-19 17:32:33 -0800
committerThomas Li <47963215+lithomas1@users.noreply.github.com>2022-03-12 18:32:55 -0800
commit028e6d141d27ba0605d4fd180a264505025bc92d (patch)
treea2026ff3b94a5260d2a7693a95d8e6943cf0aaff /.github
parentfa0881fe14ab735c4ac1822767cc2f024f650130 (diff)
downloadnumpy-028e6d141d27ba0605d4fd180a264505025bc92d.tar.gz
BLD: Make a sdist [wheel build]
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/wheels.yml60
1 files changed, 60 insertions, 0 deletions
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index 7759e2550..253dd074b 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -147,3 +147,63 @@ jobs:
# https://anaconda.org/multibuild-wheels-staging/numpy
# The tokens were originally generated at anaconda.org
upload_wheels
+ build_sdist:
+ name: Build sdist
+ needs: get_commit_message
+ if: >-
+ contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
+ github.event_name == 'schedule' ||
+ github.event_name == 'workflow_dispatch' ||
+ (github.event_name == 'pull_request' &&
+ (contains(github.event.pull_request.labels.*.name, '36 - Build') ||
+ contains(github.event.pull_request.labels.*.name, '03 - Maintenance') ||
+ contains(github.event.pull_request.labels.*.name, '14 - Release'))) ||
+ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout numpy
+ uses: actions/checkout@v2
+ with:
+ submodules: true
+ # versioneer.py requires the latest tag to be reachable. Here we
+ # fetch the complete history to get access to the tags.
+ # A shallow clone can work when the following issue is resolved:
+ # https://github.com/actions/checkout/issues/338
+ fetch-depth: 0
+ # Used to push the built wheels
+ - uses: actions/setup-python@v2
+ with:
+ # Build sdist on lowest supported Python
+ python-version: '3.8'
+ - name: Build sdist
+ run: |
+ python setup.py sdist
+ - name: Test the sdist
+ run: |
+ # TODO: Don't run test suite, and instead build wheels from sdist
+ # Depends on pypa/cibuildwheel#1020
+ python -m pip install dist/*.gz
+ pip install -r test_requirements.txt
+ cd .. # Can't import numpy within numpy src directory
+ python -c "import numpy; print(numpy.__version__); numpy.test();"
+ - uses: actions/upload-artifact@v2
+ with:
+ name: sdist
+ path: ./dist/*
+
+ - name: Upload sdist
+ if: success()
+ shell: bash
+ env:
+ NUMPY_STAGING_UPLOAD_TOKEN: ${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
+ NUMPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
+ run: |
+ source tools/wheels/upload_wheels.sh
+ set_upload_vars
+ # trigger an upload to
+ # https://anaconda.org/scipy-wheels-nightly/numpy
+ # for cron jobs or "Run workflow" (restricted to main branch).
+ # Tags will upload to
+ # https://anaconda.org/multibuild-wheels-staging/numpy
+ # The tokens were originally generated at anaconda.org
+ upload_wheels