|
| 1 | +name: Upload nightly wheels to Anaconda Cloud |
| 2 | + |
| 3 | +on: |
| 4 | + # Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud |
| 5 | + schedule: |
| 6 | + - cron: '23 1 * * *' |
| 7 | + # Run on demand with workflow dispatch |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + upload_nightly_wheels: |
| 12 | + name: Upload nightly wheels to Anaconda Cloud |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Install Python |
| 17 | + uses: actions/setup-python@v3 |
| 18 | + with: |
| 19 | + python-version: '3.x' |
| 20 | + |
| 21 | + # c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067 |
| 22 | + - name: Download wheel artifacts from last build on 'main' |
| 23 | + shell: bash |
| 24 | + env: |
| 25 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + run: | |
| 27 | + PROJECT_REPO=matplotlib/matplotlib |
| 28 | + BRANCH=main |
| 29 | + WORKFLOW_NAME="cibuildwheel.yml" |
| 30 | + ARTIFACT_NAME=wheels |
| 31 | +
|
| 32 | + gh run --repo "${PROJECT_REPO}" list --branch "${BRANCH}" --workflow "${WORKFLOW_NAME}" --json status,databaseId > runs.json |
| 33 | + # Get latest completed build of wheels |
| 34 | + RUN_ID=$(cat runs.json | jq -c '[ .[] | select(.status == "completed") ] | sort_by(.databaseId) | reverse | .[0].databaseId') |
| 35 | + gh run --repo "${PROJECT_REPO}" download "${RUN_ID}" --name "${ARTIFACT_NAME}" |
| 36 | +
|
| 37 | + mkdir dist |
| 38 | + mv *.whl dist/ |
| 39 | + ls -l dist/ |
| 40 | +
|
| 41 | + - name: Install anaconda-client |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip setuptools wheel |
| 44 | + # c.f. https://github.com/Anaconda-Platform/anaconda-client/issues/540 |
| 45 | + python -m pip install git+https://github.com/Anaconda-Server/anaconda-client |
| 46 | + python -m pip list |
| 47 | +
|
| 48 | + - name: List files to upload |
| 49 | + run: | |
| 50 | + echo "# x86_64.manylinux wheels to upload to Anaconda Cloud:" |
| 51 | + find dist -iname *x86_64.manylinux*.whl |
| 52 | +
|
| 53 | + - name: Upload x86_64.manylinux wheels to Anaconda Cloud as nightlies |
| 54 | + run: | |
| 55 | + anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} upload \ |
| 56 | + --user scipy-wheels-nightly \ |
| 57 | + dist/*x86_64.manylinux*.whl |
0 commit comments