File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 3535
3636 publish-to-pypi :
3737 name : Publish to PyPI
38- if : startsWith(github.ref, 'refs/tags/') && contains(github.ref_name, 'v') && github.ref_name matches '^v[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?$'
3938 needs :
4039 - build
4140 runs-on : ubuntu-22.04
4443 id-token : write # IMPORTANT: mandatory for trusted publishing
4544
4645 steps :
46+ - name : Extract tag name
47+ run : echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
48+
49+ - name : Validate tag format
50+ id : validate_tag
51+ run : |
52+ if [[ "${{ env.TAG_NAME }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?$ ]]; then
53+ echo "valid=true" >> $GITHUB_ENV
54+ else
55+ echo "valid=false" >> $GITHUB_ENV
56+ fi
57+
58+ - name : Exit if invalid tag
59+ if : env.valid == 'false'
60+ run : |
61+ echo "The tag ${{ env.TAG_NAME }} is not a valid semantic version. Exiting."
62+ exit 1
63+
4764 - name : Download all the distribution packages
4865 uses : actions/download-artifact@v4
4966 with :
You can’t perform that action at this time.
0 commit comments