-
Notifications
You must be signed in to change notification settings - Fork 735
40 lines (32 loc) · 989 Bytes
/
npm-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
name: Publish
on:
push:
tags: [ 'v0.[0-9]+.[0-9]+' ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: |
npm run lint
npm run test
- name: Publish to NPM
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Version already published
if: steps.publish.outputs.type == 'none'
run: |
echo "Version ${{ steps.publish.outputs.old-version }} already exists."
- name: New version published
if: steps.publish.outputs.type != 'none'
run: |
echo "New ${{ steps.publish.outputs.type }} version ${{ steps.publish.outputs.version }} published. Was ${{ steps.publish.outputs.old-version }}."