-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.83 KB
/
tag.yml
File metadata and controls
61 lines (51 loc) · 1.83 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
name: Run auto tagging
on:
workflow_run:
workflows: ["Run Tests"]
types: [completed]
branches: [main]
permissions:
contents: write
jobs:
Patch:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # Fetch full history for proper tagging
- name: Minor version for each merge
id: tag
uses: anothrNick/github-tag-action@1.73.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: minor
TAG_PREFIX: v
WITH_V: true
RELEASE_BRANCHES: main
INITIAL_VERSION: 0.1.0
- name: Update version files
if: ${{ steps.tag.outputs.new_tag != '' }}
run: |
NEW_VERSION=${{ steps.tag.outputs.new_tag }}
# Remove 'v' prefix if present
VERSION=${NEW_VERSION#v}
echo "Updating version files to: $VERSION"
# Update _version.py
sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" _version.py
# Update pyproject.toml
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
echo "Updated files:"
cat _version.py
grep "version =" pyproject.toml
- name: Commit version updates
if: ${{ steps.tag.outputs.new_tag != '' }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update version to ${{ steps.tag.outputs.new_tag }}"
file_pattern: "_version.py pyproject.toml"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"