Files
Kazier/mise.toml
T
2026-09-16 14:47:10 +02:00

96 lines
2.5 KiB
TOML

[tasks.up_backend]
description = "Start PostgreSQL + backend API (Go/Gin)"
run = [
"docker compose up -d postgres --wait",
"cd backend && go run cmd/server/main.go",
]
[tasks.up_mobile]
description = "Build + install Android debug app (device or emulator)"
dir = "mobile-kotlin"
usage = '''
arg "[target]" {
help "Where to install"
choices "device" "emulator"
default "emulator"
}
'''
run = '''
#!/usr/bin/env bash
set -euo pipefail
./gradlew :app:assembleDebug -q
APK="app/build/outputs/apk/debug/app-debug.apk"
if [ "${usage_target?}" = "emulator" ]; then
adb -e install -r "$APK"
else
adb -d install -r "$APK"
fi
'''
[tasks.test]
description = "Run all tests (Go + Kotlin)"
run = '''
set -euo pipefail
cd backend && go test ./...
cd ../mobile-kotlin && ./gradlew :app:testDebugUnitTest -q
'''
[tasks.build]
description = "Build all artifacts (Go binary + Android APK)"
run = '''
set -euo pipefail
VERSION=$(cat VERSION)
mkdir -p backend/bin
cd backend && go build -ldflags "-X main.version=$VERSION" -o bin/vaultdrop-server cmd/server/main.go
cd ../mobile-kotlin && ./gradlew :app:assembleDebug -q
'''
[tasks.lint]
description = "Lint all code (staticcheck + Android Lint)"
run = '''
set -euo pipefail
cd backend && staticcheck ./...
cd ../mobile-kotlin && ./gradlew :app:lint -q
'''
[tasks.build:release]
description = "Build signed release APK (assembleRelease)"
dir = "mobile-kotlin"
run = '''
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f app/signing.properties ] && [ -z "${SIGNING_STORE_FILE:-}" ]; then
echo "signing.properties absent — copiez app/signing.properties.example et"
echo "préparez un keystore, ou fournissez SIGNING_STORE_FILE (CI)." >&2
exit 1
fi
./gradlew :app:assembleRelease -q
echo "APK : app/build/outputs/apk/release/app-release.apk"
'''
[tasks.docker:build]
description = "Build the backend Docker image (tagged with VERSION)"
run = '''
set -euo pipefail
VERSION=$(cat VERSION)
docker build \\
--build-arg VERSION="$VERSION" \\
--build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \\
-t vaultdrop-server:"$VERSION" \\
./backend
echo "Image : vaultdrop-server:$VERSION"
'''
[tasks.release]
description = "Local release checklist: test, build artifacts, tag, push"
run = '''
set -euo pipefail
VERSION=$(cat VERSION)
echo ">>> Version : $VERSION (tag cible v$VERSION)"
mise run test
mise run build
mise run docker:build
echo
echo "Prêt à tagger ? La CI GitLab construira la release finale à partir du tag."
echo " git tag v$VERSION && git push origin v$VERSION"
'''