-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.34 KB
/
bumpversion.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
name: Bump Version
on:
workflow_dispatch:
inputs:
version_type:
description: "Version increment type (patch, minor, major)"
required: true
default: patch
type: choice
options:
- patch
- minor
- major
jobs:
bump_version:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Configure Git
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
# Install dependencies
- name: Install dependencies
run: |
pip install bumpversion setuptools wheel build
# Run bumpversion
- name: Bump version
id: bump_version
run: |
bumpversion --allow-dirty ${{ github.event.inputs.version_type }}
NEW_VERSION=$(git describe --tags --abbrev=0)
echo "New version is $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
# Push changes and tag
- name: Push changes and tag
run: |
git push origin HEAD
git push origin --tags