Skip to content

Commit a020d10

Browse files
committed
Build major tag automatically
1 parent 388f867 commit a020d10

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
git add dist/index.js
5050
git commit -m "Publish dist" || echo "Nothing to commit"
5151
git push origin main
52-
git tag --force v1
53-
git push origin v1 --force
5452
- name: Bump version and push tag
5553
uses: anothrNick/[email protected]
5654
id: version
@@ -68,3 +66,15 @@ jobs:
6866
release_name: Release ${{ steps.version.outputs.new_tag }}
6967
draft: false
7068
prerelease: false
69+
- name: Major version tag
70+
id: tag-version
71+
if: ${{ steps.version.outputs.new_tag }} != ""
72+
uses: actions/[email protected]
73+
with:
74+
script: |
75+
core.setOutput('tag', steps.version.outputs.new_tag.split('.')[1])
76+
- name: Tag ${{ steps.major-version.outputs.tag }}
77+
if: ${{ steps.version.outputs.new_tag }} != ""
78+
run: |
79+
git tag --force ${{ steps.major-version.outputs.tag }}
80+
git push origin ${{ steps.major-version.outputs.tag }} --force

0 commit comments

Comments
 (0)