forked from felixrieseberg/windows95
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yaml
146 lines (123 loc) · 3.19 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# 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
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: [install, download-disk]
cmds:
- cmd: '{{.NPM_RUN}} build'
build-debug:
deps: [install]
env:
DEBUG: 'electron-windows-installer*,electron-forge*'
cmds:
- '{{.NPM_RUN}} build'
lint:
deps: [install]
cmds:
- '{{.NPM_RUN}} lint'
start:
deps: [install]
cmds:
- '{{.NPM_RUN}} start'
download-disk:
cmds:
- task: download-disk-sh
platforms: [linux, darwin]
- task: download-disk-pwsh
platforms: [windows]
download-disk-sh:
deps: [dotenv-pull]
preconditions:
- bash --version
status:
- 'test -f "{{.TASKFILE_DIR}}/.env"'
- 'test -f "{{.TASKFILE_DIR}}/images/windows95.img"'
cmds:
- cmd: '{{.TASKFILE_DIR}}/tools/download-disk.sh'
download-disk-pwsh:
deps: [dotenv-pull]
preconditions:
- pwsh --version
status:
- 'test -f "{{.TASKFILE_DIR}}/.env"'
- 'test -f "{{.TASKFILE_DIR}}/images/windows95.img"'
cmds:
- cmd: 'pwsh -NoProfile -File "{{.TASKFILE_DIR}}/tools/download-disk.ps1"'
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'