FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

CI: Add GHA workflow to upload nightly wheels by matthewfeickert · Pull Request #22733 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) .yml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
64 changes: 64 additions & 0 deletions .github/workflows/nightlies.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Upload nightly wheels to Anaconda Cloud

on:
# Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud
schedule:
- cron: '23 1 * * *'
# Run on demand with workflow dispatch
workflow_dispatch:

jobs:
upload_nightly_wheels:
name: Upload nightly wheels to Anaconda Cloud
runs-on: ubuntu-latest
Comment thread
matthewfeickert marked this conversation as resolved.
if: github.repository_owner == 'matplotlib'

steps:
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
Comment thread
matthewfeickert marked this conversation as resolved.

# c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
- name: Download wheel artifacts from last build on 'main'
shell: bash
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,databaseId > runs.json
# Filter on 'push' events to main (merged PRs) that have completed
jq --compact-output \
'[ .[] | select(.event == "push") | select(.status == "completed") ]' \
runs.json > pushes.json
# Get id of latest build of wheels
RUN_ID=$(
jq --compact-output \
'sort_by(.databaseId) | reverse | .[0].databaseId' pushes.json
)
gh run --repo "${PROJECT_REPO}" \
download "${RUN_ID}" --name "${ARTIFACT_NAME}"

mkdir dist
mv *.whl dist/
ls -l dist/

- name: Install anaconda-client
run: |
python -m pip install --upgrade pip setuptools wheel
# c.f. https://github.com/Anaconda-Platform/anaconda-client/issues/540
python -m pip install git+https://github.com/Anaconda-Server/anaconda-client
python -m pip list

- name: Upload wheels to Anaconda Cloud as nightlies
run: |
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} upload \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

ANACONDA_ORG_UPLOAD_TOKEN is still the right secret but I do not think we will know if this works until we merge it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not sure if it is worth it, but you could manually download a wheel and then upload it with the token to test in advance that the ANACONDA_ORG_UPLOAD_TOKEN is valid. Though given that this PR enables workflow dispatch if there was something wrong with the token you could just change the value of the repo secret and rerun the job (which runs in under 1 minute) so probably not worth the time to test it out before.

--user scipy-wheels-nightly \
dist/matplotlib-*.whl
14 changes: 14 additions & 0 deletions doc/users/installing/index.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ you can install Matplotlib via your package manager, e.g.:

.. _install_from_source:

==========================
Installing a nightly build
==========================

Matplotlib makes nightly development build wheels available on the
`scipy-wheels-nightly Anaconda Cloud organization
<https://anaconda.org/scipy-wheels-nightly>`_.
These wheels can be installed with ``pip`` by specifying scipy-wheels-nightly
as the package index to query:

.. code-block:: sh

python -m pip install --upgrade --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib

======================
Installing from source
======================
Expand Down

Back | FazBrowse Home | New Git URL