-
Notifications
You must be signed in to change notification settings - Fork 214
37 lines (31 loc) · 1.17 KB
/
bump-version.yml
File metadata and controls
37 lines (31 loc) · 1.17 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
name: Bump Version
on:
workflow_dispatch:
permissions:
contents: read
jobs:
bump-version:
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
- uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
activate-environment: true
- name: Bump version
run: |
# https://github.com/bridgecrewio/checkov/blob/master/.github/workflows/build.yml#L87-L132
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch --tags
git pull origin master
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
echo "latest tag: $latest_tag"
new_tag=$(echo "$latest_tag" | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
echo "new tag: $new_tag"
uv version --offline "$new_tag"
git commit -m "Bump to ${new_tag}" pyproject.toml uv.lock || echo "No changes to commit"
git push origin