-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathTaskfile.yml
More file actions
133 lines (113 loc) · 3.49 KB
/
Copy pathTaskfile.yml
File metadata and controls
133 lines (113 loc) · 3.49 KB
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
version: "3"
vars:
APP_NAME: "massastation"
BIN_DIR: "./build/{{.APP_NAME}}"
includes:
darwin: tasks/Taskfile_darwin.yml
linux: tasks/Taskfile_linux.yml
windows: tasks/Taskfile_windows.yml
internal:
taskfile: tasks/Taskfile_internal.yml
internal: true
tasks:
install:
desc: Installs build dependencies
cmds:
- cmd: go install github.com/go-swagger/go-swagger/cmd/swagger@latest
- cmd: go install golang.org/x/tools/cmd/stringer@latest
- cmd: go install go.uber.org/mock/mockgen@v0.2.0
- cmd: go install fyne.io/tools/cmd/fyne@v1.7.0
install-dev:
desc: Installs development dependencies (fmt, lint, etc.)
cmds:
- cmd: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.3.1
- cmd: go install github.com/daixiang0/gci@latest
- cmd: go install mvdan.cc/gofumpt@latest
- cmd: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
- task: install-dev-win
install-dev-win:
desc: Installs Windows development dependencies
platforms: [windows]
cmds:
- cmd: mkdir -p build/massastation
- cmd: curl -o build/massastation/mar-tools-win64.zip https://archive.torproject.org/tor-package-archive/torbrowser/12.5.1/mar-tools-win64.zip
generate:
cmds:
- task: generate-dirs
- cmd: go generate ./...
test:
cmds:
- cmd: go test -v -timeout 60s ./...
test-e2e:
cmds:
- cmd: scripts/test-e2e.sh
test-coverage:
cmds:
- cmd: go test -timeout 60s ./... -coverprofile=coverage.coverprofile
fmt:
desc: Formats all files
cmds:
- cmd: go mod tidy
- cmd: gofumpt -l -w .
- cmd: gci write .
- task: fmt-web
- cmd: golangci-lint run --fix
fmt-web:
desc: Formats web files
dir: web/massastation
cmds:
- cmd: npm run fmt
audit-dependencies:
desc: Audits dependencies
cmds:
- cmd: govulncheck -show verbose ./...
- cmd: cd web/massastation && npm audit 2>&1 || true # ignore errors
run:
desc: Runs MassaStation in DEBUG mode
cmds:
- cmd: "{{.BIN_DIR}}/{{.APP_NAME}}{{.BIN_EXT}}"
vars:
BIN_EXT: '{{if eq .OS "windows"}}.exe{{end}}'
env:
LOG_LEVEL: DEBUG
build-frontend:
desc: Builds the frontend
dir: web/massastation
cmds:
- cmd: npm run build
build:
desc: Builds MassaStation
cmds:
- task: build-frontend
- task: linux:int-build
- task: darwin:int-build
- task: windows:int-build
build-run:
desc: Builds and runs MassaStation
cmds:
- task: build
- task: run
package:
desc: Packages MassaStation using fyne
platforms: [linux, darwin]
cmds:
- cmd: fyne package -name MassaStation -exe build/massastation/massastation -icon ./int/systray/embedded/logo.png --app-id net.massalabs.massastation {{if .OS}}--os {{.OS}}{{end}}
generate-dirs:
desc: Generates required directories for MassaStation
cmds:
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}"
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}/logs"
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}/plugins"
status:
- test -d "{{.CONFIG_DIR}}"
- test -d "{{.CONFIG_DIR}}/logs"
- test -d "{{.CONFIG_DIR}}/plugins"
vars:
CONFIG_DIR: '{{if eq OS "windows"}}{{.BIN_DIR}}{{else}}/usr/local/share/massastation{{end}}'
SUDO: '{{if ne OS "windows"}}sudo{{end}}'
all:
desc: Runs install, generate, build-run
cmds:
- task: install
- task: generate
- task: build-run