Skip to content

Commit ef70dc2

Browse files
committed
Update npm-publish.yml
1 parent 06a1415 commit ef70dc2

File tree

4 files changed

+130
-228
lines changed

4 files changed

+130
-228
lines changed

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
name: CD - Node.js Package
55

66
on:
7-
release:
8-
types: [published]
7+
push:
8+
branches:
9+
- master
10+
paths:
11+
- 'package.json'
912

1013
jobs:
1114
build:

.github/workflows/release-on-version-change.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,22 @@ jobs:
2525
id: get_version
2626
run: echo "current_version=$(jq -r '.version' package.json)" >> $GITHUB_ENV
2727

28+
- name: Create Git tag
29+
id: tag_version
30+
run: |
31+
git config user.name "github-actions"
32+
git config user.email "[email protected]"
33+
git tag v${{ env.current_version }}
34+
git push origin v${{ env.current_version }}
35+
2836
- name: Create GitHub release
2937
id: create_release
3038
uses: actions/create-release@v1
3139
env:
3240
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3341
with:
3442
tag_name: v${{ env.current_version }}
35-
release_name: Release ${{ env.current_version }}
43+
release_name: ${{ env.current_version }}
3644
body: "Automated release for version ${{ env.current_version }} of the package."
3745
draft: false
3846
prerelease: false

0 commit comments

Comments
 (0)