8000 Merge pull request #22733 from matthewfeickert/ci/upload-nightly-wheels · matplotlib/matplotlib@91f3465 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91f3465

Browse files
authored
Merge pull request #22733 from matthewfeickert/ci/upload-nightly-wheels
CI: Add GHA workflow to upload nightly wheels
2 parents da9533d + 7dda3c6 commit 91f3465

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/nightlies.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
if: github.repository_owner == 'matplotlib'
15+
16+
steps:
17+
- name: Install Python
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.x'
21+
22+
# c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
23+
- name: Download wheel artifacts from last build on 'main'
24+
shell: bash
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
PROJECT_REPO="matplotlib/matplotlib"
29+
BRANCH="main"
30+
WORKFLOW_NAME="cibuildwheel.yml"
31+
ARTIFACT_NAME="wheels"
32+
33+
gh run --repo "${PROJECT_REPO}" \
34+
list --branch "${BRANCH}" \
35+
--workflow "${WORKFLOW_NAME}" \
36+
--json event,status,databaseId > runs.json
37+
# Filter on 'push' events to main (merged PRs) that have completed
38+
jq --compact-output \
39+
'[ .[] | select(.event == "push") | select(.status == "completed") ]' \
40+
runs.json > pushes.json
41+
# Get id of latest build of wheels
42+
RUN_ID=$(
43+
jq --compact-output \
44+
'sort_by(.databaseId) | reverse | .[0].databaseId' pushes.json
45+
)
46+
gh run --repo "${PROJECT_REPO}" \
47+
download "${RUN_ID}" --name "${ARTIFACT_NAME}"
48+
49+
mkdir dist
50+
mv *.whl dist/
51+
ls -l dist/
52+
53+
- name: Install anaconda-client
54+
run: |
55+
python -m pip install --upgrade pip setuptools wheel
56+
# c.f. https://github.com/Anaconda-Platform/anaconda-client/issues/540
57+
python -m pip install git+https://github.com/Anaconda-Server/anaconda-client
58+
python -m pip list
59+
60+
- name: Upload wheels to Anaconda Cloud as nightlies
61+
run: |
62+
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} upload \
63+
--user scipy-wheels-nightly \
64+
dist/matplotlib-*.whl

doc/users/installing/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ you can install Matplotlib via your package manager, e.g.:
8080

8181
.. _install_from_source:
8282

83+
==========================
84+
Installing a nightly build
85+
==========================
86+
87+
Matplotlib makes nightly development build wheels available on the
88+
`scipy-wheels-nightly Anaconda Cloud organization
89+
<https://anaconda.org/scipy-wheels-nightly>`_.
90+
These wheels can be installed with ``pip`` by specifying scipy-wheels-nightly
91+
as the package index to query:
92+
93+
.. code-block:: sh
94+
95+
python -m pip install --upgrade --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib
96+
8397
======================
8498
Installing from source
8599
======================

0 commit comments

Comments
 (0)
0