Add tasks for gosec security scanning and WebAssembly builds in Taskfile.yml
This commit is contained in:
32
Taskfile.yml
32
Taskfile.yml
@@ -69,6 +69,11 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- revive -config revive.toml -formatter friendly ./pkg/* ./cmd/* ./internal/*
|
- revive -config revive.toml -formatter friendly ./pkg/* ./cmd/* ./internal/*
|
||||||
|
|
||||||
|
scan:
|
||||||
|
desc: Run gosec security scanner
|
||||||
|
cmds:
|
||||||
|
- gosec ./...
|
||||||
|
|
||||||
check:
|
check:
|
||||||
desc: Run fmt-check, vet, and lint
|
desc: Run fmt-check, vet, and lint
|
||||||
deps: [fmt-check, vet, lint]
|
deps: [fmt-check, vet, lint]
|
||||||
@@ -161,6 +166,33 @@ tasks:
|
|||||||
- mkdir -p {{.BUILD_DIR}}
|
- mkdir -p {{.BUILD_DIR}}
|
||||||
- tinygo build -target wasm -o {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm {{.MAIN_PACKAGE}}
|
- tinygo build -target wasm -o {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm {{.MAIN_PACKAGE}}
|
||||||
|
|
||||||
|
build-wasm:
|
||||||
|
desc: Build WebAssembly binary with standard Go compiler
|
||||||
|
env:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
cmds:
|
||||||
|
- mkdir -p {{.BUILD_DIR}}
|
||||||
|
- 'GOOS=js GOARCH=wasm {{.GOCMD}} build -o {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm {{.MAIN_PACKAGE}}'
|
||||||
|
- mkdir -p examples/wasm/static
|
||||||
|
- cp {{.BUILD_DIR}}/{{.BINARY_NAME}}.wasm examples/wasm/static/reticulum-go.wasm
|
||||||
|
|
||||||
|
build-wasm-example:
|
||||||
|
desc: Build WebAssembly example
|
||||||
|
env:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
cmds:
|
||||||
|
- mkdir -p examples/wasm/static
|
||||||
|
- 'cd examples/wasm && GOOS=js GOARCH=wasm {{.GOCMD}} build -o static/reticulum-go.wasm .'
|
||||||
|
- |
|
||||||
|
GOROOT=$({{.GOCMD}} env GOROOT)
|
||||||
|
if [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then
|
||||||
|
cp "$GOROOT/misc/wasm/wasm_exec.js" examples/wasm/
|
||||||
|
echo "wasm_exec.js copied successfully"
|
||||||
|
else
|
||||||
|
echo "Warning: wasm_exec.js not found at $GOROOT/misc/wasm/wasm_exec.js"
|
||||||
|
echo "Please copy it manually to examples/wasm/"
|
||||||
|
fi
|
||||||
|
|
||||||
install:
|
install:
|
||||||
desc: Install dependencies
|
desc: Install dependencies
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
Reference in New Issue
Block a user