-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.41 KB
/
bump-version.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
name: Bump version
on:
push:
branches:
- main
jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Get latest release tag
run: |
echo "LATEST_TAG=$(git describe --tags --abbrev=0 | cut -c 2-)" >> $GITHUB_ENV
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
commit: "false"
push: "false"
- name: Update workflow badge in README.rst
if: env.LATEST_TAG != env.REVISION
uses: junghoon-vans/varst-action@v1
env:
BADGE_LINK: https://img.shields.io/github/actions/workflow/status/junghoon-vans/varst/python-publish.yml
with:
substitutions: 'GitHub Workflow Status=${{ env.BADGE_LINK }}?branch=v${{ env.REVISION }}'
- name: Push updated files to repository
if: env.LATEST_TAG != env.REVISION
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "bump: version ${{ env.LATEST_TAG }} → ${{ env.REVISION }}"
tagging_message: "v${{ env.REVISION }}"