-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (74 loc) · 2.75 KB
/
bump-version.yml
File metadata and controls
86 lines (74 loc) · 2.75 KB
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
77
78
79
80
81
82
83
84
85
86
name: Bump Version
on:
workflow_dispatch:
inputs:
version_part:
description: 'Version part to bump (major, minor, patch)'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install bumpversion
run: |
python -m pip install --upgrade pip
pip install bump2version
- name: Configure git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Get current version
id: current_version
run: |
version=$(grep '^current_version' .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Bump version
id: bump_version
run: |
# Use --no-tag to prevent creating a tag (we'll tag after PR merge)
# Use --no-commit to let create-pull-request handle the commit
bump2version ${{ github.event.inputs.version_part }} --no-tag --no-commit
new_version=$(grep '^current_version' .bumpversion.cfg | cut -d '=' -f 2 | tr -d ' ')
echo "new_version=${new_version}" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}"
title: "chore: bump version from ${{ steps.current_version.outputs.version }} to ${{ steps.bump_version.outputs.new_version }}"
body: |
## Version Bump
This PR bumps the version from `${{ steps.current_version.outputs.version }}` to `${{ steps.bump_version.outputs.new_version }}`.
### Changes
- Updated version in `setup.py`
- Updated version in `docs/conf.py`
- Updated version in `src/datapilot/__init__.py`
- Updated version in `.bumpversion.cfg`
### Type of change
- Version bump (${{ github.event.inputs.version_part }})
---
*This PR was automatically created by the bump version workflow.*
branch: bump-version-${{ steps.bump_version.outputs.new_version }}
delete-branch: true
labels: |
version-bump
automated