-
Notifications
You must be signed in to change notification settings - Fork 44
76 lines (66 loc) · 2.19 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build and deploy
on:
push:
branches: [main, master]
paths:
- 'scss/**'
# - readme.md
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
node_version:
- 14
architecture:
- x64
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm i
- run: npm run build
- run: npm test
deploy:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- uses: dotnet/nbgv@master
id: nbgv
with:
stamp: package.json
setCommonVars: true
setAllVars: true
- run: |
echo 'NpmPackageVersion: ${{ steps.nbgv.outputs.NpmPackageVersion }}'
- run: npm install
- run: npm run build
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.nbgv.outputs.NpmPackageVersion }}
release_name: v${{ steps.nbgv.outputs.NpmPackageVersion }} Release
draft: false
prerelease: ${{ github.event_name != 'push' }}