-
Notifications
You must be signed in to change notification settings - Fork 189
48 lines (39 loc) 路 1.41 KB
/
tag-patch.yaml
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
name: Initiate new Odigos Patch version release
on:
workflow_dispatch:
permissions:
contents: write
env:
DOCKERHUB_ORG: "keyval"
jobs:
create-new-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history for all tags and branches
- name: Fetch tags
run: git fetch --tags
- name: Calculate new tag
id: newtag
run: |
latest_tag=$(git tag -l 'v*' | sort -V | tail -n1)
echo "Latest tag: $latest_tag"
major=$(echo $latest_tag | cut -d. -f1 | sed 's/v//')
minor=$(echo $latest_tag | cut -d. -f2)
patch=$(echo $latest_tag | cut -d. -f3)
new_patch=$((patch + 1))
new_tag="v$major.$minor.$new_patch"
echo "New tag: $new_tag"
echo "tag=$new_tag" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
new_tag=${{ steps.newtag.outputs.tag }}
git tag $new_tag
git push origin $new_tag
- name: Notify Slack on New Tag
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"description":"Created new tag to trigger odigos release automation", "tag":"${{ steps.newtag.outputs.tag }}"}' ${{ env.SLACK_WEBHOOK_URL }}