Skip to content

Commit 2af771d

Browse files
committed
add workflow changes
1 parent 31b10d5 commit 2af771d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/version-code-and-release.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ jobs:
4444
with:
4545
fetch-depth: 0
4646

47-
- name: Set github config
48-
run: |
49-
git config --global user.email "[email protected]"
50-
git config --global user.name "protectionsmachine"
51-
5247
- name: Check if core pyproject.toml was updated
5348
run: |
5449
BASE_COMMIT="${{ github.event.pull_request.base.sha }}"
@@ -69,7 +64,7 @@ jobs:
6964
fi
7065
fi
7166
72-
release_drafter:
67+
tag_and_draft_release:
7368
if: github.event.pull_request.merged == true
7469
runs-on: ubuntu-latest
7570
permissions:
@@ -78,6 +73,19 @@ jobs:
7873
- name: Checkout repository
7974
uses: actions/checkout@v4
8075

76+
- name: Set github config
77+
run: |
78+
git config --global user.email "[email protected]"
79+
git config --global user.name "protectionsmachine"
80+
81+
- name: Extract version from pyproject.toml and create tag
82+
id: extract_version
83+
run: |
84+
version=$(grep '^version = ' pyproject.toml | cut -d '"' -f2)
85+
echo "Detected version: $version"
86+
git tag -a "v$version" -m "Release version $version"
87+
git push origin "v$version"
88+
8189
- name: Run Release Drafter
8290
uses: release-drafter/release-drafter@v6
8391
with:

0 commit comments

Comments
 (0)