-
Notifications
You must be signed in to change notification settings - Fork 83
40 lines (32 loc) · 1.13 KB
/
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: Npm.js deploy
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
- run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- run: echo ${VERSION}
- run: echo "NG_CLI_ANALYTICS=false" >> $GITHUB_ENV
- run: echo "NODE_OPTIONS='--max_old_space_size=4096'" >> $GITHUB_ENV
- run: npm ci
- run: grunt build
# define npm tag
- run: if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then echo "NPM_TAG=next"; else echo "NPM_TAG=latest"; fi >> $GITHUB_ENV
- run: echo ${NPM_TAG}
# copy readme
- run: cp ../README.md README.md
working-directory: dist
# create version and publish it to npmjs
- run: npm version ${VERSION} --no-git-tag-version --save --verbose
working-directory: dist
- run: npm publish --tag ${NPM_TAG}
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}