forked from copy/v86
-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yaml
116 lines (97 loc) · 2.5 KB
/
taskfile.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# https://taskfile.dev
version: "3"
set: [pipefail]
shopt: [globstar]
dotenv:
- .env
vars:
BUILD_DIR: "{{ .TASKFILE_DIR }}/build"
BIN_DIR: "{{ .BUILD_DIR }}/bin"
BREW: "/home/linuxbrew/.linuxbrew/bin/brew"
BREW_INSTALL_SCRIPT: "{{ .BIN_DIR }}/install-brew.sh"
BREW_INSTALL_URI: "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
RUN_WINDOWS: "cmd /d /c"
RUN_UNIX: "sh -c"
RUN: '{{if eq OS "windows"}}{{.RUN_WINDOWS}}{{ else }}{{.RUN_UNIX}}{{ end }}'
DOTENV_VAULT: npx --yes dotenv-vault@latest
NPM: yarn
NPM_RUN: '{{ if eq .NPM "yarn" }}{{.NPM}}{{ else }}{{.NPM}} run{{ end }}'
env:
NODE_OPTIONS: "--trace-deprecation --trace-warnings --max-old-space-size=2048"
ELECTRON_ENABLE_LOGGING: true
ELECTRON_RUN_AS_NODE: true
tasks:
default:
cmds:
- task: build
# https://developers.google.com/closure/compiler
closure-install:
status:
- java --version
- brew --version
- closure-compiler --version
cmds:
- cmd: brew install closure-compiler
setup:
deps: [closure-install]
cmds:
- cmd: rustup target add wasm32-unknown-unknown
clean:
cmds:
- cmd: rm -rf "{{.TASKFILE_DIR}}/.yarn/"
platforms: [linux]
- cmd: rm -f "{{.TASKFILE_DIR}}/yarn.lock"
platforms: [linux]
- cmd: rm -f "{{.TASKFILE_DIR}}/package-lock.json"
platforms: [linux]
rebuild:
deps: [clean]
cmds:
- task: build
build:
deps: [setup]
cmds:
- cmd: make all
install:
cmds:
- cmd: "{{.NPM}} install"
- task: install-dependencies-ubuntu
install-dependencies-ubuntu:
platforms: [linux]
preconditions:
- apt-get --version
- sudo --version
status:
- rpm --version
cmds:
- cmd: sudo apt-get update
- cmd: sudo apt-get install -y rpm
dotenv-login:
internal: true
status:
- 'test -f "{{ .TASKFILE_DIR }}/.env.me"'
sources:
- .env.vault
generates:
- .env.me
cmds:
- cmd: "{{ .DOTENV_VAULT }} login --yes"
dotenv-push:
internal: true
deps: [dotenv-login]
preconditions:
- 'test -f "{{ .TASKFILE_DIR }}/.env"'
- 'test -f "{{ .TASKFILE_DIR }}/.env.me"'
- 'test -f "{{ .TASKFILE_DIR }}/.env.vault"'
cmds:
- cmd: "{{ .DOTENV_VAULT }} push --yes"
dotenv-pull:
deps: [dotenv-login]
status:
- 'test -f "{{ .TASKFILE_DIR }}/.env"'
sources:
- .env.vault
generates:
- .env
cmds:
- cmd: "{{ .DOTENV_VAULT }} pull --yes"