forked from dxatscale/sfpowerscripts
-
Notifications
You must be signed in to change notification settings - Fork 20
58 lines (49 loc) · 1.32 KB
/
buildPackages.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
name: 'Build Packages'
on:
workflow_call:
inputs:
version:
type: string
default: ''
publish:
type: boolean
default: false
environment:
type: string
required: true
secrets:
npm-token:
required: false
jobs:
build:
name: 'Build Package'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: 'Set Git Config'
run: |
git config --global user.email "ciuser@flxbl.io"
git config --global user.name "ciuser"
- name: 'Install Dependencies'
run: npm i
- name: 'Build Package'
run: npm run build
- name: 'Run Unit Tests'
if: ${{ inputs.publish == true }}
run: npm run test -- --colors
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: 'Publish Package'
if: ${{ inputs.publish == true }}
run: npm publish --tag ${{ inputs.version }}
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-token }}