File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 workflow_dispatch :
33 inputs :
44 publish_version :
5+ description : ' Version to publish (e.g., 2.6.5)'
56 required : true
67 type : string
8+ publish_to_real_pypi :
9+ description : ' Actually publish to the real PyPI (not just test site)?'
10+ required : true
11+ type : boolean
12+ default : false
713
814jobs :
915 log-the-inputs :
1016 runs-on : ubuntu-latest
1117 steps :
1218 - run : |
1319 echo "target version: ${{ github.event.inputs.publish_version }}"
20+ echo "publish to real pypi: ${{ github.event.inputs.publish_to_real_pypi }}"
1421 env:
1522 VERSION: ${{ github.event.inputs.publish_version }}
1623
17- upload-to-pypi :
18- name : Publish to PyPI test site
24+ build-and-publish :
25+ name : Build and Publish
1926 runs-on : ubuntu-latest
2027 steps :
2128 - name : Dump GitHub context
@@ -86,10 +93,22 @@ jobs:
8693 attestations : false
8794
8895 - name : Publish to PyPI
96+ if : github.event.inputs.publish_to_real_pypi == 'true'
8997 uses : pypa/gh-action-pypi-publish@release/v1
9098 with :
9199 password : ${{ secrets.PYPI_API }}
92100 repository_url : https://upload.pypi.org/legacy/
93101 attestations : false
94102
103+ - name : Create GitHub Release
104+ if : github.event.inputs.publish_to_real_pypi == 'true'
105+ uses : softprops/action-gh-release@v1
106+ with :
107+ tag_name : v${{ github.event.inputs.publish_version }}
108+ name : Release Version ${{ github.event.inputs.publish_version }}
109+ files : dist/*
110+ generate_release_notes : true
111+ env :
112+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113+
95114
You can’t perform that action at this time.
0 commit comments