-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1017 Bytes
/
bump.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
name: Automatically bump the package version
on:
push:
branches:
- main
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install setuptools_scm
- name: Figure out the next tag
shell: python
id: get_next_tag
run: |
import os
import setuptools_scm
from packaging import version
v = version.parse(setuptools_scm.get_version())
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'tag=v{v.major}.{v.minor}.{v.micro + 1}', file=fh)
- name: Debug the next tag
run: echo ${{ steps.get_next_tag.outputs.tag }}
- name: Create a tag and push it
run: |
git tag ${{ steps.get_next_tag.outputs.tag }}
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}