Skip to content

Commit dc55762

Browse files
authored
Update publish.yml
1 parent 9584af9 commit dc55762

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ jobs:
1919
git config user.name "${GITHUB_ACTOR}"
2020
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
2121
- run: echo "NPM_PACKAGE_VERSION=$(npm version patch --no-git-tag-version)" | tee -a $GITHUB_ENV
22+
- run: echo "NPM_PACKAGE_VERSION_MAJOR=$(echo "${{ env.NPM_PACKAGE_VERSION }}" | cut -d. -f1)" | tee -a $GITHUB_ENV
2223
- run: git add package.json package-lock.json
23-
- name: Update README.md with new version
24-
run: |
24+
- run: |
2525
sed -i "s|\(uses: forproxyband/vector-code-map@\)v[0-9.]*|\1${{ env.NPM_PACKAGE_VERSION }}|g" README.md
2626
- run: git add README.md
2727
- run: |
2828
git commit -m "Set version ${{ env.NPM_PACKAGE_VERSION }} by ${GITHUB_ACTOR}"
2929
git push -u origin main
30-
git tag -a ${{ env.NPM_PACKAGE_VERSION }} -m "Add tag ${{ env.NPM_PACKAGE_VERSION }}"
30+
git tag -a ${{ env.NPM_PACKAGE_VERSION_MAJOR }} -m "Add major tag ${{ env.NPM_PACKAGE_VERSION_MAJOR }}"
31+
git push origin ${{ env.NPM_PACKAGE_VERSION_MAJOR }}
32+
git tag -fa ${{ env.NPM_PACKAGE_VERSION }} -m "Add tag ${{ env.NPM_PACKAGE_VERSION }}"
3133
git push origin ${{ env.NPM_PACKAGE_VERSION }}
3234
env:
3335
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)