File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 env :
7171 GH_TOKEN : ${{ github.token }}
7272 TAG : ${{ github.ref_name }}
73- run : gh release create "${TAG}" dist/* --verify-tag --generate-notes --title "${TAG}"
73+ run : |
74+ flags=()
75+ # A pre-release (v0.5.1rc1) is marked as one, so it never becomes the latest
76+ # release, which is what the weekly patch run rebuilds and people install.
77+ if [[ ! "${TAG#v}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
78+ flags+=(--prerelease)
79+ fi
80+ gh release create "${TAG}" dist/* --verify-tag --generate-notes --title "${TAG}" "${flags[@]}"
7481
7582 # PyPI, through trusted publishing: PyPI trusts this workflow running in the pypi
7683 # environment, so no token is stored anywhere. It runs last because a version on PyPI
Original file line number Diff line number Diff line change @@ -77,6 +77,11 @@ tab; the full scan is kept with each run.
77773 . ` just release ` : it checks the tree is clean and in step with ` origin/main ` , that the
7878 changelog has the version and the tag is new, then tags and pushes.
7979
80+ A pre-release, for trying a build where only PyPI (or a proxy of it, such as JFrog) can be
81+ reached, is the same with a version such as ` 0.5.1rc1 ` . PyPI takes it, but only asking for that
82+ version by name (or ` --pre ` ) gets it; the GitHub release is marked a pre-release, and its
83+ images get only their exact tags, so ` latest ` , ` slim ` and the docs stay on the last release.
84+
8085The release workflow runs CI again as a gate, builds, scans and pushes both images with
8186attestations, and only then creates the GitHub release with the wheel, sdist and
8287` SHA256SUMS ` . A release never exists without its images.
Original file line number Diff line number Diff line change @@ -127,11 +127,16 @@ def test_install_lines_name_the_current_release():
127127 found
128128 for page in PAGES
129129 for found in re .findall (
130- rf"install [^\n]*(?:@v|{ re .escape (brand .DISTRIBUTION )} ==)(\d+\.\d+\.\d+)" ,
130+ rf"install [^\n]*(?:@v|{ re .escape (brand .DISTRIBUTION )} ==)"
131+ r"(\d+\.\d+\.\d+(?:(?:a|b|rc)\d+|\.dev\d+)?)" ,
131132 page .read_text (),
132133 )
133134 }
134- assert pinned == {version }
135+ if re .fullmatch (r"\d+\.\d+\.\d+" , version ):
136+ assert pinned == {version }
137+ else :
138+ # A pre-release (0.5.1rc1) is for trying out: the docs stay on the last release.
139+ assert len (pinned ) == 1 , pinned
135140
136141
137142def test_the_readme_pypi_gets_links_to_files_that_exist ():
You can’t perform that action at this time.
0 commit comments