Skip to content

Commit 5b648e7

Browse files
authored
Create create-tag-from-version
1 parent 65fff90 commit 5b648e7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create tag from new version
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
paths:
8+
- pyproject.toml
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
setup-tag:
15+
runs-on: "ubuntu-latest"
16+
steps:
17+
- name: Check out package
18+
uses: actions/checkout@v4
19+
20+
- name: Get package version
21+
run: |
22+
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
23+
echo "pyproject.toml version: $VERSION"
24+
git config user.name github-actions
25+
git config user.email [email protected]
26+
MSG=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline)
27+
echo "Creating tag $VERSION with message:"
28+
echo "$MSG"
29+
git tag -a "$VERSION" -m "$MSG"
30+
31+
- name: Publish tags
32+
run: git push --tags

0 commit comments

Comments
 (0)