-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
285 lines (252 loc) · 8.83 KB
/
Taskfile.yml
File metadata and controls
285 lines (252 loc) · 8.83 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
version: '3'
vars:
BINARY_NAME: lankir
BUILD_DIR: build/bin
FRONTEND_DIR: frontend
tasks:
default:
desc: Show available tasks
cmds:
- task --list
dev:
desc: Run the application in development mode with hot reload
cmds:
- wails dev
build:
desc: Build the application for production
cmds:
- echo "Building frontend..."
- cd {{.FRONTEND_DIR}} && ./build.sh
- echo "Building application..."
- wails build -clean
- echo "✓ Build complete! Binary at {{.BUILD_DIR}}/{{.BINARY_NAME}}"
build-static:
desc: Build a portable binary for distribution (requires GTK3 on target)
cmds:
- ./scripts/build-static.sh
appimage:
desc: Build a truly portable AppImage (runs on any Linux distro)
cmds:
- ./scripts/build-appimage.sh
appimage-clean:
desc: Build AppImage with clean cache (force rebuild all dependencies)
cmds:
- ./scripts/build-appimage.sh --force
build-deb:
desc: Build Debian package (.deb)
cmds:
- |
if ! command -v nfpm &> /dev/null; then
echo "Error: nfpm is not installed."
echo "Install with: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest"
exit 1
fi
- task: build
- |
VERSION=$(grep '"productVersion":' wails.json | sed 's/.*"productVersion": "\(.*\)".*/\1/')
echo "Building .deb package for version ${VERSION}..."
VERSION=${VERSION} nfpm package --packager deb --target build/bin/
echo "✓ Debian package built: build/bin/lankir_${VERSION}_amd64.deb"
build-rpm:
desc: Build RPM package (.rpm)
cmds:
- |
if ! command -v nfpm &> /dev/null; then
echo "Error: nfpm is not installed."
echo "Install with: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest"
exit 1
fi
- task: build
- |
VERSION=$(grep '"productVersion":' wails.json | sed 's/.*"productVersion": "\(.*\)".*/\1/')
echo "Building .rpm package for version ${VERSION}..."
VERSION=${VERSION} nfpm package --packager rpm --target build/bin/
echo "✓ RPM package built: build/bin/lankir-${VERSION}-1.x86_64.rpm"
build-packages:
desc: Build all distribution packages (deb, rpm, AppImage, static)
cmds:
- echo "Building all distribution packages..."
- task: build-static
- task: appimage
- task: build-deb
- task: build-rpm
- echo "✓ All packages built successfully!"
- echo ""
- echo "Built packages:"
- ls -lh build/bin/ | grep -E "\.(deb|rpm|AppImage)$|_static$"
appimage-test:
desc: Test the built AppImage
cmds:
- |
if [ ! -f build/bin/lankir-*.AppImage ]; then
echo "Error: AppImage not found. Run 'task appimage' first."
exit 1
fi
echo "Testing AppImage..."
build/bin/lankir-*.AppImage --help || true
echo "✓ AppImage executable"
appimage-extract:
desc: Extract AppImage contents for inspection
cmds:
- |
if [ ! -f build/bin/lankir-*.AppImage ]; then
echo "Error: AppImage not found. Run 'task appimage' first."
exit 1
fi
cd build/bin && ./lankir-*.AppImage --appimage-extract
echo "✓ AppImage extracted to build/bin/squashfs-root"
appimage-check-deps:
desc: Check for missing dependencies in AppImage
cmds:
- |
if [ ! -d build/bin/squashfs-root ]; then
echo "Extracting AppImage first..."
task appimage-extract
fi
echo "Checking main binary..."
ldd build/bin/squashfs-root/usr/bin/lankir | grep "not found" && exit 1 || echo "✓ No missing dependencies for main binary"
echo "Checking WebKitWebProcess..."
ldd build/bin/squashfs-root/usr/bin/WebKitWebProcess | grep "not found" && exit 1 || echo "✓ No missing dependencies for WebKitWebProcess"
echo "Checking WebKitNetworkProcess..."
ldd build/bin/squashfs-root/usr/bin/WebKitNetworkProcess | grep "not found" && exit 1 || echo "✓ No missing dependencies for WebKitNetworkProcess"
appimage-info:
desc: Show information about the built AppImage
cmds:
- |
if [ ! -f build/bin/lankir-*.AppImage ]; then
echo "Error: AppImage not found. Run 'task appimage' first."
exit 1
fi
APPIMAGE=$(ls build/bin/lankir-*.AppImage)
echo "AppImage Information:"
echo "===================="
echo "Location: $APPIMAGE"
echo "Size: $(du -h "$APPIMAGE" | cut -f1)"
echo "File type: $(file "$APPIMAGE" | cut -d: -f2-)"
echo ""
if [ -d build/appimage/AppDir ]; then
echo "AppDir size: $(du -sh build/appimage/AppDir | cut -f1)"
echo "GStreamer plugins: $(ls build/appimage/AppDir/usr/lib/gstreamer-1.0/ 2>/dev/null | wc -l)"
echo "WebKit processes: $(ls build/appimage/AppDir/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/ 2>/dev/null | grep -c Process || echo 0)"
fi
clean:
desc: Remove build artifacts (keeps cached tools like linuxdeploy)
cmds:
- echo "Cleaning build artifacts..."
- rm -rf {{.BUILD_DIR}}
- rm -rf build/appimage/AppDir
- rm -rf build/bin/squashfs-root
- rm -f build/bin/*.AppImage
- rm -f lankir lankir-*
- rm -f {{.FRONTEND_DIR}}/dist/style.css
- echo "✓ Clean complete (cached tools preserved)"
clean-cache:
desc: Remove cached build tools and AppImage dependencies cache
cmds:
- echo "Removing cached build tools and dependencies..."
- rm -rf build/linuxdeploy-tools
- rm -rf build/appimage-cache
- rm -f build/appimagetool-x86_64.AppImage
- echo "✓ Build caches cleared"
clean-all:
desc: Deep clean - remove all generated files including Wails bindings and caches
cmds:
- echo "Performing deep clean..."
- rm -rf {{.BUILD_DIR}}
- rm -rf build/
- rm -f lankir lankir-*
- rm -rf {{.FRONTEND_DIR}}/dist/
- rm -rf {{.FRONTEND_DIR}}/wailsjs/
- rm -rf {{.FRONTEND_DIR}}/node_modules/.cache/
- rm -f coverage.out coverage.html
- rm -rf .wails-build-cache/
- go clean -cache -testcache -modcache
- echo "✓ Deep clean complete"
frontend:
desc: Build only the frontend
cmds:
- echo "Building frontend..."
- cd {{.FRONTEND_DIR}} && ./build.sh
- echo "✓ Frontend built"
test:
desc: Run all tests
cmds:
- echo "Running Go tests..."
- go test -v ./...
- echo "Running JavaScript tests..."
- cd {{.FRONTEND_DIR}} && npm test
test-backend:
desc: Run Go tests only
cmds:
- echo "Running Go tests..."
- go test -v ./...
test-frontend:
desc: Run JavaScript tests only
cmds:
- echo "Running JavaScript tests..."
- cd {{.FRONTEND_DIR}} && npm test
test-coverage:
desc: Run tests with coverage report
cmds:
- echo "Running Go tests with coverage..."
- go test -v -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
- echo "Go coverage report generated in coverage.html"
- echo "Running JavaScript tests with coverage..."
- cd {{.FRONTEND_DIR}} && npm run test:coverage
- echo "JS coverage report generated in frontend/coverage/index.html"
lint:
desc: Run linters (requires golangci-lint)
cmds:
- echo "Running linters..."
- golangci-lint run ./...
deps:
desc: Download and verify dependencies
cmds:
- echo "Downloading Go dependencies..."
- go mod download
- go mod verify
- echo "✓ Dependencies ready"
tidy:
desc: Tidy Go modules
cmds:
- go mod tidy
- echo "✓ Go modules tidied"
bindings:
desc: Generate Wails bindings
cmds:
- echo "Generating Wails bindings..."
- wails generate module
- echo "✓ Bindings generated"
install-deps:
desc: Install system dependencies (Ubuntu/Debian)
cmds:
- echo "Installing system dependencies..."
- sudo apt update
- sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev libnss3-dev
- echo "✓ System dependencies installed"
run:
desc: Build and run the application
deps: [build]
cmds:
- ./{{.BUILD_DIR}}/{{.BINARY_NAME}}
release:
desc: Create a new release with automatic version detection
cmds:
- ./scripts/release.sh --auto
release-patch:
desc: Create a patch release (bug fixes)
cmds:
- ./scripts/release.sh --patch
release-minor:
desc: Create a minor release (new features)
cmds:
- ./scripts/release.sh --minor
release-major:
desc: Create a major release (breaking changes)
cmds:
- ./scripts/release.sh --major
release-dry-run:
desc: Preview what a release would do without making changes
cmds:
- ./scripts/release.sh --auto --dry-run