Skip to content

Commit 57cbb08

Browse files
FEAT: Add workflow to sync release tags from PyAEDT (#454)
Co-authored-by: Sébastien Morais <[email protected]>
1 parent 3d7be00 commit 57cbb08

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Sync release tag from PyAEDT
2+
3+
on:
4+
repository_dispatch:
5+
types: [release_tag]
6+
7+
jobs:
8+
create-tag:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
persist-credentials: false
17+
18+
- name: Validate tag input
19+
run: |
20+
TAG_NAME="${{ github.event.client_payload.tag }}"
21+
if [[ -z "$TAG_NAME" ]]; then
22+
echo "Error: No tag provided in the payload"
23+
exit 1
24+
fi
25+
echo "Tag to create: $TAG_NAME"
26+
27+
- name: Create and push tag
28+
run: |
29+
# Configure git username & email
30+
git config --global user.name "${{ secrets.PYANSYS_CI_BOT_USERNAME }}"
31+
git config --global user.email "${{ secrets.PYANSYS_CI_BOT_EMAIL }}"
32+
33+
TAG_NAME="${{ github.event.client_payload.tag }}"
34+
35+
if [[ -z "$TAG_NAME" ]]; then
36+
echo "Error: No tag provided in the payload"
37+
exit 1
38+
fi
39+
echo "Tag to create: $TAG_NAME"
40+
41+
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
42+
echo "Tag $TAG_NAME already exists, skipping creation"
43+
exit 0
44+
fi
45+
46+
echo "Creating tag: $TAG_NAME"
47+
git tag "$TAG_NAME"
48+
49+
echo "Pushing tag to origin"
50+
git push origin "$TAG_NAME"
51+
52+
echo "Successfully created and pushed tag: $TAG_NAME"

0 commit comments

Comments
 (0)