Repository navigation
115 lines (97 loc) · 3.31 KB
/
Copy pathnightly-wheels.yml
File metadata and controls
115 lines (97 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Upload nightly wheels
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-artifacts:
name: Build artifacts
runs-on: ubuntu-latest
if: github.repository == 'pydata/xarray'
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: prefix-dev/setup-pixi@v0.11.3
with:
cache: false
environments: build-wheels
- name: Build tarball and wheels
id: build
run: |
pixi run build-wheels
- name: Check built artifacts
id: check
run: |
pixi run -e build-wheels python -m twine check --strict dist/*
pwd
if [ -f dist/xarray-0.0.0.tar.gz ]; then
echo "❌ INVALID VERSION NUMBER"
exit 1
else
echo "✅ Looks good"
fi
- uses: actions/upload-artifact@v7.0.2
with:
name: releases
path: dist
upload:
name: Publish artifacts
needs: build-artifacts
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
environment:
name: scientific-python-nightly-wheels
permissions:
contents: read
issues: write # report failing uploads
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@v8.0.2
with:
name: releases
path: dist
- name: Upload wheel
id: upload
uses: scientific-python/upload-nightly-action@0.6.6
with:
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY }}
artifacts_path: dist
- name: Create or update failure issue
if: failure()
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
ISSUE_LABEL: "CI"
ISSUE_TITLE: "Nightly wheel build/upload failed"
GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository}}/actions/runs/${{ github.run_id }}
TEMPLATE: ".github/nightly-wheel-failure-template.md"
run: |
# Read the template
template=$(cat "$TEMPLATE")
# Replace placeholders
issue_body="${template//\{\{WORKFLOW\}\}/$GITHUB_WORKFLOW}"
issue_body="${issue_body//\{\{RUN_ID\}\}/$GITHUB_RUN_ID}"
issue_body="${issue_body//\{\{RUN_URL\}\}/$GITHUB_RUN_URL}"
issue_body="${issue_body//\{\{DATE\}\}/$(date -u)}"
# Check for existing open issue with same title
existing_issue=$(gh issue list --state open --label "$ISSUE_LABEL" --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 "$ISSUE_LABEL"
echo "Created new issue"
fi