-
-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (44 loc) · 1.44 KB
/
publish.yaml
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
49
50
51
52
53
54
55
name: Publish to NPM on Github Release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.NITRIC_BOT_TOKEN }}
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: 'node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- name: Use Node 14
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
always-auth: true
- name: Git Identity
run: |
git config --global user.name 'nitric-bot[bot]'
git config --global user.email '[email protected]'
- name: Set Version
# Tag will already be created by release flow
run: npm version --no-git-tag-version ${{ github.event.release.tag_name }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Publish latest to NPM
if: '!github.event.release.prerelease'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish latest RC to NPM
if: 'github.event.release.prerelease'
run: npm publish --access public --tag rc-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}