-
Notifications
You must be signed in to change notification settings - Fork 8
/
Taskfile.yml
157 lines (136 loc) · 4.27 KB
/
Taskfile.yml
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
147
148
149
150
151
152
153
154
155
156
157
version: "3"
tasks:
install:
cmds:
- echo "Installing dependencies"
- cmd: sudo apt update && sudo apt install -y libgtk-3-0 libwebkit2gtk-4.1-dev
platforms: [linux]
ignore_error: true
- cmd: go install github.com/go-swagger/go-swagger/cmd/swagger@latest
- cmd: go install github.com/wailsapp/wails/v2/cmd/[email protected]
platforms: [linux, windows]
- cmd: GOARCH=amd64 go install github.com/wailsapp/wails/v2/cmd/[email protected]
platforms: [darwin/amd64]
- cmd: GOARCH=arm64 go install github.com/wailsapp/wails/v2/cmd/[email protected]
platforms: [darwin/arm64]
- cmd: go install github.com/daixiang0/gci@latest
generate:
cmds:
- cmd: go generate ./...
- cmd: gci write .
clean:
cmds:
# kill the zombie goroutines
- cmd: pgrep -f wallet.test | xargs -r kill -9 &>/dev/null
platforms: [linux, darwin]
- cmd: rm -f internal/handler/wallet/wallet_*.yaml &>/dev/null
platforms: [linux, darwin]
test:
cmds:
- task: clean
- cmd: go test -v -timeout 20s ./...
fmt:
cmds:
- cmd: go mod tidy
- cmd: gofumpt -l -w .
- cmd: gci write .
- cmd: golangci-lint run
- task: fmt-wails
- task: fmt-web
fmt-wails:
dir: wails-frontend
cmds:
- cmd: npm run fmt
fmt-web:
dir: web-frontend
cmds:
- cmd: npm run fmt
build:
cmds:
- task: build-linux
- task: build-macos
- task: build-windows
build-linux:
platforms: [linux]
cmds:
- cmd: mkdir -p build/wallet-plugin
- cmd: go build -o build/wallet-plugin/wallet-plugin -tags desktop,production,webkit2_41 -ldflags "-w -s" main.go
build-macos:
platforms: [darwin]
cmds:
- cmd: wails build -s -skipbindings
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers
build-windows:
platforms: [windows]
cmds:
- cmd: mkdir -p build/wallet-plugin
- cmd: go build -tags desktop,production -ldflags "-w -s -H windowsgui" -o build/wallet-plugin/wallet-plugin.exe main.go
build-webapp:
dir: web-frontend
cmds:
- cmd: npm run build:standalone
build-wails:
dir: wails-frontend
cmds:
- cmd: npm run build
wails-dev:
cmds:
- cmd: wails dev
env:
STANDALONE: 1
install-plugin:
cmds:
- cmd: mkdir -p /usr/local/share/massastation/plugins/wallet-plugin
platforms: [linux, darwin]
- cmd: cp build/wallet-plugin/wallet-plugin /usr/local/share/massastation/plugins/wallet-plugin
platforms: [linux]
- cmd: cp -r build/bin/wallet-plugin.app /usr/local/share/massastation/plugins/wallet-plugin
platforms: [darwin]
- cmd: cp wallet.svg /usr/local/share/massastation/plugins/wallet-plugin
platforms: [linux, darwin]
- cmd: cp manifest.json /usr/local/share/massastation/plugins/wallet-plugin
platforms: [linux, darwin]
- cmd: mkdir -p "C:/Program Files (x86)/MassaStation/plugins/wallet-plugin"
platforms: [windows]
- cmd: cp build/wallet-plugin/wallet-plugin.exe "C:/Program Files (x86)/MassaStation/plugins/wallet-plugin"
platforms: [windows]
- cmd: cp wallet.svg "C:/Program Files (x86)/MassaStation/plugins/wallet-plugin"
platforms: [windows]
- cmd: cp manifest.json "C:/Program Files (x86)/MassaStation/plugins/wallet-plugin"
platforms: [windows]
run:
cmds:
- cmd: ./build/bin/wallet-plugin.app/Contents/MacOS/wallet-plugin
platforms: [darwin]
- cmd: ./build/wallet-plugin/wallet-plugin
platforms: [linux]
- cmd: ./build/wallet-plugin/wallet-plugin.exe
platforms: [windows]
env:
STANDALONE: 1
build-standalone:
cmds:
- task: build-webapp
- task: build-wails
- task: build
build-run:
cmds:
- task: build-standalone
- task: run
build-install-plugin:
cmds:
- task: generate
- task: build
- task: install-plugin
all:
cmds:
- task: install
- task: generate
- task: build
clear-accounts:
cmds:
- cmd: rm ~/Library/Application\ Support/massa-station-wallet/wallet_*.yaml
platforms: [darwin]
- cmd: rm ~/.config/massa-station-wallet/wallet_*.yaml
platforms: [linux]