Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 469b424

Browse filesBrowse files
committed
ci: Only attempt to upload nightlies from successful builds
Also, print out status of the chosen build, and clean up yamllint warnings.
1 parent 3309b15 commit 469b424
Copy full SHA for 469b424

File tree

Expand file treeCollapse file tree

1 file changed

+22
-21
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-21
lines changed

‎.github/workflows/nightlies.yml

Copy file name to clipboardExpand all lines: .github/workflows/nightlies.yml
+22-21Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Upload nightly wheels to Anaconda Cloud
23

34
on:
@@ -14,13 +15,10 @@ jobs:
1415
upload_nightly_wheels:
1516
name: Upload nightly wheels to Anaconda Cloud
1617
runs-on: ubuntu-latest
17-
defaults:
18-
run:
19-
shell: bash -l {0}
2018
if: github.repository_owner == 'matplotlib'
2119

2220
steps:
23-
# c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
21+
# https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
2422
- name: Download wheel artifacts from last build on 'main'
2523
env:
2624
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -33,16 +31,20 @@ jobs:
3331
gh run --repo "${PROJECT_REPO}" \
3432
list --branch "${BRANCH}" \
3533
--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
34+
--json event,status,conclusion,databaseId > runs.json
4235
RUN_ID=$(
4336
jq --compact-output \
44-
'sort_by(.databaseId) | reverse | .[0].databaseId' pushes.json
37+
'[
38+
.[] |
39+
# Filter on "push" events to main (merged PRs) ...
40+
select(.event == "push") |
41+
# that have completed successfully ...
42+
select(.status == "completed" and .conclusion == "success")
43+
] |
44+
# and get ID of latest build of wheels.
45+
sort_by(.databaseId) | reverse | .[0].databaseId' runs.json
4546
)
47+
gh run --repo "${PROJECT_REPO}" view "${RUN_ID}"
4648
gh run --repo "${PROJECT_REPO}" \
4749
download "${RUN_ID}" --name "${ARTIFACT_NAME}"
4850
@@ -71,17 +73,16 @@ jobs:
7173
N_LATEST_UPLOADS=5
7274
7375
# Remove all _but_ the last "${N_LATEST_UPLOADS}" package versions
74-
# N.B.: `anaconda show` places the newest packages at the bottom of the output
75-
# of the 'Versions' section and package versions are preceded with a ' + '.
76+
# N.B.: `anaconda show` places the newest packages at the bottom of
77+
# the output of the 'Versions' section and package versions are
78+
# preceded with a ' + '.
7679
anaconda show scipy-wheels-nightly/matplotlib &> >(grep '+') | \
7780
sed 's/.* + //' | \
7881
head --lines "-${N_LATEST_UPLOADS}" > remove-package-versions.txt
7982
80-
if [ -s remove-package-versions.txt ]; then
81-
while LANG=C IFS= read -r package_version ; do
82-
echo "# Removing scipy-wheels-nightly/matplotlib/${package_version}"
83-
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \
84-
--force \
85-
"scipy-wheels-nightly/matplotlib/${package_version}"
86-
done <remove-package-versions.txt
87-
fi
83+
while LANG=C IFS= read -r package_version ; do
84+
echo "Removing scipy-wheels-nightly/matplotlib/${package_version}"
85+
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \
86+
--force \
87+
"scipy-wheels-nightly/matplotlib/${package_version}"
88+
done <remove-package-versions.txt

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.