@@ -21,35 +21,52 @@ jobs:
2121 with :
2222 python-version : ${{ matrix.python-version }}
2323
24- - uses : actions/cache@v2
24+ - name : " Calver calculate version"
25+ uses : StephaneBour/actions-calver@master
26+ id : calver
2527 with :
26- path : ~/.cache/pip
27- # This is like the example but we use ``*requirements.txt`` rather
28- # than ``requirements.txt`` because we have multiple requirements
29- # files.
30- key : ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
31- restore-keys : |
32- ${{ runner.os }}-pip-
33-
34- - name : " Install dependencies"
35- run : |
36- python -m pip install --upgrade pip setuptools wheel
37- # We use '--ignore-installed' to avoid GitHub's cache which can cause
38- # issues - we have seen packages from this cache cause trouble with
39- # pip-extra-reqs.
40- python -m pip install --ignore-installed --upgrade --editable .[dev]
28+ date_format : " %Y.%m.%d"
29+ release : false
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4132
42- - name : " Publish a release"
33+ - name : " Update changelog"
34+ uses : jacobtomlinson/gha-find-replace@v2
4335 env :
44- GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
45- run : |
46- python admin/release.py
36+ NEXT_VERSION : ${{ steps.calver.outputs.release }}
37+ with :
38+ find : " Next\n ----"
39+ replace : " Next\n ----\n\n ${{ env.NEXT_VERSION }}\n ------------"
40+ include : " CHANGELOG.rst"
41+ regex : false
42+
43+ - uses : stefanzweifel/git-auto-commit-action@v4
44+ id : commit
45+ with :
46+ commit_message : Bump CHANGELOG
47+
48+ - name : Bump version and push tag
49+ id : tag_version
50+ uses : mathieudutour/github-tag-action@v6.0
51+ with :
52+ github_token : ${{ secrets.GITHUB_TOKEN }}
53+ custom_tag : ${{ steps.calver.outputs.release }}
54+ tag_prefix : " "
55+ commit_sha : ${{ steps.commit.outputs.commit_hash }}
56+
57+ - name : Create a GitHub release
58+ uses : ncipollo/release-action@v1
59+ with :
60+ tag : ${{ steps.tag_version.outputs.new_tag }}
61+ name : Release ${{ steps.tag_version.outputs.new_tag }}
62+ body : ${{ steps.tag_version.outputs.changelog }}
4763
4864 - name : Build a binary wheel and a source tarball
4965 run : |
5066 # Checkout the latest tag - the one we just created.
5167 git fetch --tags
5268 git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
69+ python -m pip install build
5370 python -m build --sdist --wheel --outdir dist/ .
5471
5572 - name : Publish distribution 📦 to PyPI
0 commit comments