1
- name : Minor Release
1
+ name : Release snapshot (creates a snapshot from the develop branch or from the input-provided source)
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
+ source :
7
+ description : ' Source to release from (e.g., release-2211.20.0). By default, the develop branch is used.'
8
+ required : false
6
9
version :
7
10
description : ' Release version (e.g., 2211.20.0 or 2211.20.0-1)'
8
- required : false
11
+ required : true
9
12
10
13
jobs :
11
14
release :
14
17
- name : Checkout code
15
18
uses : actions/checkout@v4
16
19
with :
17
- ref : develop
20
+ ref : ${{ github.event.inputs.source || ' develop' }}
18
21
19
22
- name : Configure Git
20
23
run : |
96
99
git add .
97
100
git commit -m "Release ${{ env.version }}"
98
101
git push origin "${{ env.RELEASE_BRANCH }}"
99
-
102
+
103
+ - name : Tag the release
104
+ run : |
105
+ git fetch origin "${{ env.RELEASE_BRANCH }}"
106
+ git checkout "${{ env.RELEASE_BRANCH }}"
107
+
108
+ TAG="${{ env.version }}"
109
+
110
+ # Check if tag already exists
111
+ if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then
112
+ echo "Tag $TAG already exists. Skipping creation."
113
+ else
114
+ git tag -a "$TAG" -m "$TAG"
115
+ git push origin "$TAG"
116
+ echo "Created and pushed tag: $TAG"
117
+ fi
118
+
119
+ - name : Sync branch to a private repo
120
+ env :
121
+ GH_TOKEN : ${{ secrets.GH_PR_TOKEN }}
122
+ run : |
123
+ echo "Triggering repo-sync.yml with branch: ${{ env.RELEASE_BRANCH }}"
124
+
125
+ curl -X POST \
126
+ -H "Accept: application/vnd.github+json" \
127
+ -H "Authorization: Bearer $GH_TOKEN" \
128
+ https://api.github.com/repos/${{ github.repository }}/actions/workflows/repo-sync.yml/dispatches \
129
+ -d "{\"ref\":\"${{ env.RELEASE_BRANCH }}\",\"inputs\":{\"branch_to_sync\":\"${{ env.RELEASE_BRANCH }}\"}}"
0 commit comments