-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (96 loc) · 3.48 KB
/
Copy pathrelease.yml
File metadata and controls
104 lines (96 loc) · 3.48 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
name: Release
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash -l {0} # required for conda env
jobs:
build_wheels:
name: Wheels
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.3
with:
fetch-depth: 0 # history required so setuptools_scm can determine version
- uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.71.2
environments: build
frozen: true
- name: Build wheels
run: pixi run --frozen build
- name: Upload wheels
uses: actions/upload-artifact@v7.0.1
with:
name: dist
path: dist
# Skipping conda upload since we directly deploy to conda-forge
upload_pypi:
name: Deploy PyPI
needs: [build_wheels]
runs-on: ubuntu-24.04
environment: release
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v8.0.1
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@v1.14.0
docs:
needs: [upload_pypi]
uses: ./.github/workflows/docs.yml
with:
publish: ${{ github.event_name == 'release' && github.event.action == 'published' }}
secrets: inherit
assets:
name: Upload docs
needs: docs
runs-on: ubuntu-slim
permissions:
contents: write # This is needed so that the action can upload the asset
steps:
- uses: actions/download-artifact@v8.0.1
with:
name: docs_html
path: docs_html
- name: Zip documentation
run: |
mv docs_html documentation-${{ github.ref_name }}
zip -r documentation-${{ github.ref_name }}.zip documentation-${{ github.ref_name }}
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} ./documentation-${{ github.ref_name }}.zip --repo ${{ github.repository }}
todo-reminder:
# Q: Why we don't automatically publish the new dataset?
# A: New regression test file should have most complicated metadata as much as possible.
# However, the values should also be reasonablly realistic so that the users or
# other contributors can easily understand why they are about from the test files.
# It was easy enough for humans to fill such values in the test files manually.
# On the other hand, it is not impossible to automate generating the regression test file
# and I (owner) is not against automating it so feel free to automate it if you have time for it.
# Q: Why do we automate reminding it though?
# A: The regression test is triggered only when there is a new PR or the nightly is triggered.
# New regression test file was forgotten to be updated until there was a CI failure since the last release.
name: Remind to update the regression test dataset
needs: upload_pypi
runs-on: ubuntu-slim
permissions:
issues: write # Remind by opening an issue.
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v6.1.0
- name: Open an issue.
env:
GITHUB_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
gh issue create -t "New regression test file for ${TAG}" \
-l CI \
-b "Release for ${TAG} was successful. \
Regression test file should be updated in tests/_regression_test_files."