-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.26 KB
/
tagging.yml
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
name: Auto Tagging
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "aws_fusion/**"
- "setup.py"
concurrency: tagging
jobs:
tag:
runs-on: ubuntu-latest
name: Auto Tagging
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Get package information
id: package_info
run: |
current_version=$(./setup.py --version)
tag_does_not_exist=true
if git rev-parse "refs/tags/$current_version" >/dev/null 2>&1; then
tag_does_not_exist=false
else
echo "::warning title=Tag already exists::${current_version}"
fi
echo "version=${current_version}" >> "$GITHUB_OUTPUT"
echo "tag_does_not_exists=${tag_does_not_exist}" >> "$GITHUB_OUTPUT"
- name: Add git tag
if: ${{ steps.package_info.outputs.tag_does_not_exists == 'true' }}
run: |
git tag ${{ steps.package_info.outputs.version }}
git push origin ${{ steps.package_info.outputs.version }}