-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (63 loc) · 2.14 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: Release
on: workflow_dispatch
jobs:
build:
name: Publish a release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: "Calver calculate version"
uses: StephaneBour/actions-calver@master
id: calver
with:
date_format: "%Y.%m.%d"
release: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Update changelog"
uses: jacobtomlinson/gha-find-replace@v2
env:
NEXT_VERSION: ${{ steps.calver.outputs.release }}
with:
find: "Next\n----"
replace: "Next\n----\n\n${{ env.NEXT_VERSION }}\n------------"
include: "CHANGELOG.rst"
regex: false
- uses: stefanzweifel/git-auto-commit-action@v4
id: commit
with:
commit_message: Bump CHANGELOG
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.calver.outputs.release }}
tag_prefix: ""
commit_sha: ${{ steps.commit.outputs.commit_hash }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Build a binary wheel and a source tarball
run: |
# Checkout the latest tag - the one we just created.
git fetch --tags
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
python -m pip install build
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true