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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/nightly-wheel-failure-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Nightly Wheel Build/Upload Failed

**Workflow:** {{WORKFLOW}}
**Run:** [{{RUN_ID}}]({{RUN_URL}})
**Date:** {{DATE}}

The nightly wheel build or upload to the `scientific-python-nightly-wheels` index has failed.

Please check the [workflow run]({{RUN_URL}}) for details.

This issue was automatically generated from the nightly wheel workflow.
40 changes: 40 additions & 0 deletions .github/workflows/nightly-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read
issues: write

jobs:
cron:
runs-on: ubuntu-latest
Expand All @@ -21,12 +26,14 @@ jobs:
python -m pip install build twine

- name: Build tarball and wheels
id: build
run: |
git clean -xdf
git restore -SW .
python -m build

- name: Check built artifacts
id: check
run: |
python -m twine check --strict dist/*
pwd
Expand All @@ -38,7 +45,40 @@ jobs:
fi

- name: Upload wheel
id: upload
uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf # 0.6.3
with:
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY }}
artifacts_path: dist

- name: Create or update failure issue
if: ${{ failure() }}
shell: bash
run: |
# Read the template
template=$(cat .github/nightly-wheel-failure-template.md)

# Replace placeholders
issue_body="${template//\{\{WORKFLOW\}\}/${{ github.workflow }}}"
issue_body="${issue_body//\{\{RUN_ID\}\}/${{ github.run_id }}}"
issue_body="${issue_body//\{\{RUN_URL\}\}/${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}}"
issue_body="${issue_body//\{\{DATE\}\}/$(date -u)}"

# Check for existing open issue with same title
issue_title="Nightly wheel build/upload failed"
existing_issue=$(gh issue list --state open --label "CI" --search "\"$issue_title\" in:title" --json number --jq '.[0].number // empty')

if [ -n "$existing_issue" ]; then
echo "Found existing open issue #$existing_issue, updating it..."
echo "$issue_body" | gh issue edit "$existing_issue" --body-file -
echo "Updated existing issue #$existing_issue"
else
echo "No existing open issue found, creating new one..."
echo "$issue_body" | gh issue create \
--title "$issue_title" \
--body-file - \
--label "CI"
echo "Created new issue"
fi
env:
GH_TOKEN: ${{ github.token }}
Loading