-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.39 KB
/
build.yaml
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
on:
# Triggers the workflow on pull request
pull_request:
# Allows to trigger workflow manually
workflow_dispatch:
# Allows to call this workflow from another workflow
workflow_call:
inputs:
should_pack:
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run : npm ci --ignore-scripts
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Pack build reults
if: ${{ inputs.should_pack == true }}
run: npm pack
- name: Get version
id: get_version
if: ${{ inputs.should_pack == true }}
run: |
VERSION=$(node -pe 'require("./package.json").version')
echo "::set-output name=version::$VERSION"
- name: Upload build result
if: ${{ inputs.should_pack == true }}
uses: actions/upload-artifact@v3
with:
name: ukorvl-react-on-screen-${{ steps.get_version.outputs.version }}
path: ukorvl-react-on-screen-${{ steps.get_version.outputs.version }}.tgz
if-no-files-found: error
retention-days: 1