Skip to content

Commit 56ec4f5

Browse files
authored
Merge pull request #11 from UnmannedAerialSystems/tedtasman-patch-2
Create bump-version.yml
2 parents 7d8023e + d18beb2 commit 56ec4f5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/bump-version.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Bump version files on tag push
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
bump-version:
10+
name: Update version files
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Extract version from tag
22+
id: tag
23+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
24+
25+
- name: Update pyproject.toml and conf.py
26+
run: |
27+
VERSION=${{ steps.tag.outputs.VERSION }}
28+
echo "🔧 Setting version to $VERSION"
29+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
30+
sed -i "s/^release = \".*\"/release = \"$VERSION\"/" docs/conf.py
31+
sed -i "s/^version = \".*\"/version = \"${VERSION%.*}\"/" docs/conf.py
32+
33+
- name: Commit and push version updates
34+
run: |
35+
git config user.name "github-actions"
36+
git config user.email "github-actions@users.noreply.github.com"
37+
git commit -am "Auto bump version files to ${{ steps.tag.outputs.VERSION }}"
38+
git push origin HEAD:main

0 commit comments

Comments
 (0)