| | --- |
| | name: Upload nightly wheels to Anaconda Cloud |
| |
|
| | on: |
| | |
| | schedule: |
| | - cron: '23 1 * * *' |
| | |
| | workflow_dispatch: |
| |
|
| | permissions: |
| | actions: read |
| |
|
| | jobs: |
| | upload_nightly_wheels: |
| | name: Upload nightly wheels to Anaconda Cloud |
| | runs-on: ubuntu-latest |
| | defaults: |
| | run: |
| | |
| | |
| | |
| | shell: bash -e -l {0} |
| | if: github.repository_owner == 'matplotlib' |
| |
|
| | steps: |
| | |
| | - name: Download wheel artifacts from last build on 'main' |
| | env: |
| | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| | run: | |
| | PROJECT_REPO="matplotlib/matplotlib" |
| | BRANCH="main" |
| | WORKFLOW_NAME="cibuildwheel.yml" |
| | ARTIFACT_NAME="wheels" |
| | |
| | gh run --repo "${PROJECT_REPO}" \ |
| | list --branch "${BRANCH}" \ |
| | --workflow "${WORKFLOW_NAME}" \ |
| | --json event,status,conclusion,databaseId > runs.json |
| | RUN_ID=$( |
| | jq --compact-output \ |
| | '[ |
| | .[] | |
| | # Filter on "push" events to main (merged PRs) ... |
| | select(.event == "push") | |
| | # that have completed successfully ... |
| | select(.status == "completed" and .conclusion == "success") |
| | ] | |
| | # and get ID of latest build of wheels. |
| | sort_by(.databaseId) | reverse | .[0].databaseId' runs.json |
| | ) |
| | gh run --repo "${PROJECT_REPO}" view "${RUN_ID}" |
| | gh run --repo "${PROJECT_REPO}" \ |
| | download "${RUN_ID}" --name "${ARTIFACT_NAME}" |
| |
|
| | mkdir dist |
| | mv *.whl dist/ |
| | ls -l dist/ |
| |
|
| | - name: Upload wheels to Anaconda Cloud as nightlies |
| | uses: scientific-python/upload-nightly-action@8f0394fd2aa0c85d7364a9958652e8994e06b23c |
| | with: |
| | artifacts_path: dist |
| | anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} |
| |
|