File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 types : [published]
66
77jobs :
8+ validate-release :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Validate pre-release consistency
12+ env :
13+ TAG_NAME : ${{ github.event.release.tag_name }}
14+ IS_PRERELEASE : ${{ github.event.release.prerelease }}
15+ run : |
16+ PEP440_PRE=$(echo "$TAG_NAME" | grep -qE '(\.dev|a|b|rc)[0-9]+' && echo "true" || echo "false")
17+
18+ if [ "$IS_PRERELEASE" = "true" ] && [ "$PEP440_PRE" = "false" ]; then
19+ echo "::error::GitHub release is marked as pre-release but tag '$TAG_NAME' is a stable version. Use a PEP 440 pre-release suffix (e.g. .dev1, rc1)."
20+ exit 1
21+ fi
22+
23+ if [ "$IS_PRERELEASE" = "false" ] && [ "$PEP440_PRE" = "true" ]; then
24+ echo "::error::Tag '$TAG_NAME' has a pre-release suffix but the GitHub release is not marked as pre-release. Check the 'Set as a pre-release' box."
25+ exit 1
26+ fi
27+
28+ echo "Release consistency check passed: tag=$TAG_NAME, prerelease=$IS_PRERELEASE"
29+
830 publish :
31+ needs : validate-release
932 runs-on : ubuntu-latest
1033 environment :
1134 name : pypi
You can’t perform that action at this time.
0 commit comments