diff options
author | mattip <matti.picus@gmail.com> | 2022-01-24 18:36:30 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2022-01-24 18:36:30 +0200 |
commit | 7c310f3bcbb547189f8a9c64a8e111ec7d7fbb63 (patch) | |
tree | a0b924f9c66bca3e5b3eab50ada5dc05ab387490 | |
parent | 6218e76bc590e9253ed8d4c4b18c74aa81332b15 (diff) | |
download | numpy-7c310f3bcbb547189f8a9c64a8e111ec7d7fbb63.tar.gz |
BUILD: upload wheels to anaconda
-rw-r--r-- | .github/workflows/wheels.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6a05c5830..2ee9c0dfa 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -125,3 +125,50 @@ jobs: with: name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }} path: ./wheelhouse/*.whl + + - name: Setup Upload Variables + if: ${{ always() }} + shell: bash + run: | + if [ "push" == "${{ github.event_name }}" ] && [ "${{ startsWith(github.ref, 'refs/tags/v') }}" ]; then + echo push and tag event + echo "ANACONDA_ORG=multibuild-wheels-staging" >> $GITHUB_ENV + echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV + echo "ANACONDA_UPLOAD=true" >> $GITHUB_ENV + elif [ "schedule" == "${{ github.event_name }}" ] || [ "workflow_dispatch" == "${{ github.event_name }}" ]; then + echo scheduled or dispatched event + echo "ANACONDA_ORG=scipy-wheels-nightly" >> $GITHUB_ENV + echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV + echo "ANACONDA_UPLOAD=true" >> $GITHUB_ENV + else + echo non-dispatch event + echo "ANACONDA_UPLOAD=false" >> $GITHUB_ENV + fi + - name: Upload wheels + if: ${{ always() }} + shell: bash + run: | + # trigger an upload to the shared ecosystem + # infrastructure at: https://anaconda.org/scipy-wheels-nightly + # for cron jobs only (restricted to main branch once + # per week) + # SCIPY_WHEELS_NIGHTLY_ACCESS is a secret token + # used in Travis CI config, originally + # + # for merges (push events) we use the staging area instead; + # MULTIBUILD_WHEELS_STAGING_ACCESS is a secret token used in Travis + # CI config, originally generated at anaconda.org for + # multibuild-wheels-staging + # generated at anaconda.org for scipy-wheels-nightly + echo ${PWD} + if [ ${ANACONDA_UPLOAD} == true ]; then + if [ -z ${TOKEN} ]; then + echo no token set, not uploading + else + python -m pip install git+https://github.com/Anaconda-Server/anaconda-client + ls ./wheelhouse/*.whl + anaconda -t ${TOKEN} upload --force -u ${ANACONDA_ORG} ./wheelhouse/*.whl + echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple" + fi + fi + |