1- name : Build Python distributions, publish on PyPI, and create a GH release
1+ name : Build Python distributions, publish on PyPI, and create a GitHub release
22
33on :
44 workflow_dispatch :
55 push :
66 tags :
77 - " v*.*.*"
88
9+ env :
10+ PYPI_PROJECT_URL : " https://pypi.org/p/django-altcha"
11+
912jobs :
1013 build-python-dist :
1114 name : Build Python distributions
1417 contents : read
1518
1619 steps :
17- - name : Checkout
20+ - name : Checkout repository
1821 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1922 with :
2023 persist-credentials : false # do not keep the token around
4851 runs-on : ubuntu-24.04
4952 environment :
5053 name : pypi
51- url : https://pypi.org/p/django-altcha
54+ url : ${{ env.PYPI_PROJECT_URL }}
5255 permissions :
5356 id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
5457
@@ -71,15 +74,18 @@ jobs:
7174 contents : write
7275
7376 steps :
77+ - name : Checkout repository
78+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
79+ with :
80+ persist-credentials : false
81+
7482 - name : Download package distributions
7583 uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
7684 with :
7785 name : python-package-distributions
7886 path : dist/
7987
80- - name : Create GH release
81- uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
82- with :
83- draft : false
84- generate_release_notes : true
85- files : dist/*
88+ - name : Create GitHub release
89+ run : gh release create "$GITHUB_REF_NAME" dist/* --generate-notes
90+ env :
91+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments