Skip to content

Commit 4304652

Browse files
committed
configure npm publish via CI
1 parent 6c2c64c commit 4304652

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Test and Publish
22

33
on:
44
pull_request:
@@ -30,3 +30,22 @@ jobs:
3030

3131
- name: Test
3232
run: npm test -- --run
33+
34+
- id: check
35+
uses: EndBug/version-check@v2
36+
with:
37+
file-name: package.json
38+
diff-search: true
39+
40+
- name: Publish package on NPM 📦
41+
if: steps.check.outputs.changed == 'true'
42+
run: npm publish
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
46+
- name: Release
47+
if: steps.check.outputs.changed == 'true'
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
tag_name: ${{ steps.check.outputs.version }}
51+
prerelease: false

0 commit comments

Comments
 (0)