aboutsummaryrefslogtreecommitdiff
path: root/lib/Taskfile.yaml
blob: 70912f443f1e0aceb9edec864c9f37c5bd1d5341 (plain)
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

#taskfile for building the libraries for admin and clients and creating their packages

version: '3'

tasks:

  package-update:
    dir: '{{.USER_WORKING_DIR}}'
    cmds:
     - npm update

  build:
    dir: '{{.USER_WORKING_DIR}}'
    cmds:
    
    - cmd: npm version {{ .BUILD_VERSION }}
      ignore_error: true #error if run when version is not updated
    #install deps and run build
    - npm install
    - npm run build
    
  #copy artifacts to temp directory
  postbuild_success:
    dir: '{{.USER_WORKING_DIR}}'
    vars:
      PACKAGE_FILES:
        dist/*
        package.json
        package-lock.json
        README.md
        tsconfig.json

    cmds:
    - cmd: powershell mkdir bin/ -Force
    #tar the package and put it in the output dir
    - tar -czf bin/release.tgz {{ .PACKAGE_FILES }}

  #clean hook
  clean:
    dir: '{{.USER_WORKING_DIR}}'
    ignore_error: true
    cmds:
    - for: [node_modules/, dist/, bin/]
      cmd: powershell -Command "Remove-Item -Recurse -Force {{.ITEM}}"