-
-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (56 loc) · 1.77 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Publish
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js
uses: actions/setup-node@master
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install dependencies
run: yarn
- name: Build app
run: yarn build
- name: Run tests
run: yarn test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Publish NPM
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
run: cd dist && npm publish --access public
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 --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# - name: Set up package for GPR
# run: yarn gpr:setup
# - name: Use GPR
# uses: actions/setup-node@master
# with:
# node-version: 13
# registry-url: https://npm.pkg.github.com/
# scope: 'bartholomej'
# - name: Publish to GitHub Package Registry
# run: |
# cd dist
# npm publish
# env:
# NODE_AUTH_TOKEN: ${{github.token}}