@@ -3,7 +3,7 @@ name: PyPI-Release
33on :
44 push :
55 branches :
6- - master
6+ - main
77
88jobs :
99 build-and-publish :
@@ -13,16 +13,34 @@ jobs:
1313 - name : Set up Python
1414 uses : actions/setup-python@v1
1515 with :
16- python-version : " 3.x"
17- - name : Install build dependencies
18- run : pip install -U setuptools wheel build
19- - name : Build
20- run : python -m build .
21- - name : Publish
22- uses : pypa/gh-action-pypi-publish@master
16+ python-version : " 3.9"
17+ - name : Set Release Version
18+ run : echo "RELEASE=$(grep 'version' pyproject.toml | cut -d \" -f2)" >> $GITHUB_ENV
19+ - name : Set up npm
20+ uses : actions/setup-node@v2
2321 with :
24- password : ${{ secrets.pypi_password }}
25- - name : Install GitPython and cdevents for pypi_packaging
26- run : pip install -U -r requirements/publish.txt
27- - name : Create Tag
28- run : python pypi_packaging.py
22+ node-version : ' 12'
23+ -
run :
git config --global user.email "[email protected] " 24+ - run : git config --global user.name "GitHub Actions"
25+ - name : Install github-changes
26+ run : |
27+ npm install -g github-changes
28+ - name : Generate Changelog
29+ run : |
30+ github-changes -o ${GITHUB_REPOSITORY///*} -r ${GITHUB_REPOSITORY##*/} -a --only-pulls --use-commit-body -k ${{ secrets.GITHUB_TOKEN }} -b main -n "${{ env.RELEASE }}" -m "(YYYY-MM-DD)" -t "Changelog" -f "CHANGELOG.md"
31+ git add CHANGELOG.md
32+ git commit -m "Updated CHANGELOG.md"
33+ - name : Push changes to release branch
34+ run : |
35+ git push origin main
36+ - name : Create Release
37+ id : create_release
38+ uses : actions/create-release@v1
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+ with :
42+ tag_name : " ${{ env.RELEASE }}"
43+ release_name : " Release ${{ env.RELEASE }}"
44+ body_path : " CHANGELOG.md"
45+ draft : false
46+ prerelease : false
0 commit comments