Skip to content

Commit 4abeaeb

Browse files
committed
ci(release): add steps to update partial version reference tags
1 parent 58b95a0 commit 4abeaeb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,29 @@ jobs:
5353
ref: ${{ github.ref_name }}
5454

5555
- name: Python Semantic Release
56+
id: release
5657
uses: python-semantic-release/[email protected]
5758
with:
5859
github_token: ${{ secrets.GITHUB_TOKEN }}
5960
root_options: "-vv -c releaserc.toml"
6061
force: ${{ github.event.inputs.bump-version }}
6162
prerelease: ${{ github.event.inputs.as-prerelease }}
6263
changelog: false
64+
65+
- name: Update Minor Release Tag Reference
66+
if: steps.release.outputs.released == 'true'
67+
env:
68+
FULL_VERSION_TAG: ${{ steps.release.outputs.tag }}
69+
run: |
70+
MINOR_VERSION_TAG=$(echo $FULL_VERSION_TAG | cut -d. -f1,2)
71+
git tag --force --annotate "$MINOR_VERSION_TAG" "${VERSION}^{}" -m "$MINOR_VERSION_TAG"
72+
git push -u origin "$MINOR_VERSION_TAG" --force
73+
74+
- name: Update Major Release Tag Reference
75+
if: steps.release.outputs.released == 'true'
76+
env:
77+
FULL_VERSION_TAG: ${{ steps.release.outputs.tag }}
78+
run: |
79+
MAJOR_VERSION_TAG=$(echo $FULL_VERSION_TAG | cut -d. -f1)
80+
git tag --force --annotate "$MAJOR_VERSION_TAG" "${VERSION}^{}" -m "$MAJOR_VERSION_TAG"
81+
git push -u origin "$MAJOR_VERSION_TAG" --force

0 commit comments

Comments
 (0)