-
Notifications
You must be signed in to change notification settings - Fork 85
66 lines (56 loc) · 2.29 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
name: Release
on: create
jobs:
release:
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.TOWNCRIER_TOKEN }}
fetch-depth: 0
submodules: true
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Extract the tag
id: vars
run: |
echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Check tag validity
env:
VERSION: ${{ steps.vars.outputs.tag }}
run: |
grep "^v[[:digit:]]\.[[:digit:]]\.[[:digit:]]$" <<< "$VERSION" || (echo "Invalid version: '$VERSION'" && exit 42)
- name: Install dependencies
run: |
sudo apt install pandoc
python -m pip install --upgrade pip
pip install tox bump2version
pip install -e '.'
- name: Check generated docs
run: |
tox -e check-docs
- name: Bump the version
# the part (patch) doesn't matter when supplying --new-version
env:
VERSION: ${{ steps.vars.outputs.tag }}
run: |
bump2version patch --no-commit --no-tag --verbose --new-version "${VERSION/v/}"
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: .bumpversion.cfg
commit_user_name: CI
commit_message: ${{ format('[auto][ci skip] Release {0}', steps.vars.outputs.tag) }}
tagging_message: ${{ steps.vars.outputs.tag }}
skip_dirty_check: false
# `Test` triggers `Deployment`
# TODO(michalk8): can't find WD for `Test`
- name: Invoke deployment workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Deployment
token: ${{ secrets.RELEASE_DISPATCH_TOKEN }}
inputs: '{ "reason": "release" }'