-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (44 loc) · 1.25 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
43
44
45
46
47
48
name: publish
on:
push:
branches:
- master
jobs:
versionist:
name: Run versionist
if: "!contains(github.event.head_commit.author.name, 'versionist')"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.versionist.outputs.version }}
updated: ${{ steps.versionist.outputs.updated }}
steps:
- name: Checkout project code
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Run balena-versionist
id: versionist
uses: tmigone/versionist@master
with:
github_email: 'tmigone.versionist@gmail.com'
github_username: 'versionist'
github_token: ${{ secrets.GH_VERSIONIST_TOKEN }}
publish:
name: Publish package to NPM
needs: versionist
if: needs.versionist.outputs.updated == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout project code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm version --no-git-tag-version ${{ needs.versionist.outputs.version }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}