-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
CI: Add GHA workflow to upload nightly wheels #22733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
if: github.repository_owner == 'matplotlib' | ||
|
||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
matthewfeickert marked this conversation as resolved.
Show resolved
Hide 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 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c.f. #21637 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
--user scipy-wheels-nightly \ | ||
dist/matplotlib-*.whl |
Uh oh!
There was an error while loading. Please reload this page.