-
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (36 loc) · 1.06 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: publish package npm
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
# https://semver.org/ proper release tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+'
# prerelease tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+-*'
env:
NODE_VERSION: 14.15.5
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: show tag
id: tag
run: |
echo ::set-output name=TAG::${GITHUB_REF##*/}
- name: publish package npm
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.tag.outputs.TAG }}
- if: steps.publish.outputs.type != 'none'
run: |
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"