forked from Celtian/dbmaster-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.33 KB
/
main.yml
File metadata and controls
84 lines (70 loc) · 2.33 KB
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
77
78
79
80
81
82
83
84
name: Build & Publish
on:
push:
tags:
- 'v*'
jobs:
install-and-build:
name: Install & Build
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}-
${{ runner.OS }}-yarn-
${{ runner.OS }}-
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Run tests
run: yarn test --collectCoverage --ci
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: true
verbose: false
dry_run: false
- name: Publish NPM
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: cd dist && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish NPM BETA
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == true
run: cd dist && npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# Publish to GitHub Package Registry
- name: Set up package for GPR
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: yarn gpr:setup
- name: Use GPR
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: https://npm.pkg.github.com/
scope: '@celtian'
- name: Publish to GitHub Package Registry
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: |
cd dist
npm publish
env:
NODE_AUTH_TOKEN: ${{github.token}}