-
Notifications
You must be signed in to change notification settings - Fork 1.3k
166 lines (146 loc) · 4.8 KB
/
Copy pathrelease.yml
File metadata and controls
166 lines (146 loc) · 4.8 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Release
on:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
outputs:
tag: ${{ steps.tag.outputs.name }}
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Create tag
id: tag
run: |
version="v$(yq -p toml '.project.version' pyproject.toml)"
if git rev-parse "refs/tags/$version" >/dev/null 2>&1; then
echo "Error: Tag $version already exists"
exit 1
fi
git tag "$version"
git push origin "$version"
echo "Created and pushed tag $version"
echo "name=$version" >> "$GITHUB_OUTPUT"
- name: Create draft release
uses: release-drafter/release-drafter@4d75298e00d9e34c483e5ff8c68d0ea1c1940c1e # v7.5.1
with:
name: ${{ steps.tag.outputs.name }}
tag: ${{ steps.tag.outputs.name }}
include-pre-releases: true
prerelease: ${{ contains(steps.tag.outputs.name, '-') }}
publish: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
generate:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
preset:
- general
- minimal
- mainnet
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- gloas
- heze
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
- name: Generate tests
run: make test preset=${{ matrix.preset }} fork=${{ matrix.fork }} reftests=true
- name: Upload reference tests
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: reftests-${{ matrix.preset }}-${{ matrix.fork }}
path: reftests/${{ matrix.preset }}
if-no-files-found: ignore
package:
needs: [setup, generate]
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
strategy:
matrix:
preset:
- general
- minimal
- mainnet
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Package reference tests
uses: ./.github/actions/package
with:
name: ${{ matrix.preset }}
artifact-prefix: reftests
source-path: tests/${{ matrix.preset }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release
run: gh release upload "${{ needs.setup.outputs.tag }}" ${{ matrix.preset }}.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
publish:
needs: [setup, package]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Publish release
run: gh release edit "${{ needs.setup.outputs.tag }}" --draft=false
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
- name: Generate specs
run: uv run python -m pysetup.generate_specs --all-forks
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
trigger-comptests:
needs: [setup, publish]
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Trigger compliance test generation
run: |
gh workflow run comptests.yml \
--ref "${{ needs.setup.outputs.tag }}" \
--field repo="${{ github.repository }}" \
--field ref="${{ needs.setup.outputs.tag }}" \
--field release="${{ needs.setup.outputs.tag }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}