@@ -3,7 +3,7 @@ name: PyPI-Release
3
3
on :
4
4
push :
5
5
branches :
6
- - master
6
+ - main
7
7
8
8
jobs :
9
9
build-and-publish :
@@ -13,16 +13,34 @@ jobs:
13
13
- name : Set up Python
14
14
uses : actions/setup-python@v1
15
15
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
23
21
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