3232 needs : ci
3333 runs-on : ubuntu-latest
3434 concurrency : release
35- permissions :
36- id-token : write
37- contents : write
35+
3836 steps :
3937 - uses : actions/checkout@v4
4038 with :
@@ -48,23 +46,28 @@ jobs:
4846
4947 - name : Install semantic-release
5048 run : pip install python-semantic-release
51-
49+
5250 - name : Configure Git
5351 run : |
5452 git config --global user.name "github-actions[bot]"
5553 git config --global user.email "github-actions[bot]@users.noreply.github.com"
56-
57- - name : Semantic release
54+
55+ - name : Run Semantic Release
56+ run : |
57+ # Create CHANGELOG.md if it doesn't exist
58+ if [ ! -f CHANGELOG.md ]; then
59+ echo "# Changelog" > CHANGELOG.md
60+ echo "" >> CHANGELOG.md
61+ echo "<!--next-version-->" >> CHANGELOG.md
62+ echo "" >> CHANGELOG.md
63+ echo "All notable changes to this project will be documented in this file." >> CHANGELOG.md
64+ fi
65+ semantic-release version
66+ semantic-release publish
5867 env :
5968 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60- run :
61- semantic-release --version
62- semantic-release publish
6369
6470 - name : Build and publish to PyPI
65- env :
66- TWINE_USERNAME : __token__
67- TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
6871 run : |
6972 # Only build and publish if a new tag was created
7073 if git describe --tags --exact-match HEAD >/dev/null 2>&1; then
7477 twine upload dist/* --verbose
7578 else
7679 echo "No new release, skipping PyPI upload"
77- fi
80+ fi
81+ env :
82+ TWINE_USERNAME : __token__
83+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments