Add build automation and CI publishing workflow
Some checks failed
Android CI / build (push) Has been cancelled

This commit is contained in:
dom4k
2026-03-16 19:04:20 +00:00
parent c833fd467d
commit 842bfb4c9d
4 changed files with 124 additions and 0 deletions

18
scripts/bump_version.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_FILE="$ROOT_DIR/android/app/build.gradle.kts"
current_code="$(grep -E 'versionCode = [0-9]+' "$BUILD_FILE" | head -n1 | sed -E 's/.*versionCode = ([0-9]+)/\1/')"
current_name="$(grep -E 'versionName = "[0-9]+\.[0-9]+\.[0-9]+"' "$BUILD_FILE" | head -n1 | sed -E 's/.*versionName = "([0-9]+\.[0-9]+\.[0-9]+)"/\1/')"
IFS='.' read -r major minor patch <<< "$current_name"
new_code=$((current_code + 1))
new_patch=$((patch + 1))
new_name="${major}.${minor}.${new_patch}"
sed -i -E "s/versionCode = [0-9]+/versionCode = ${new_code}/" "$BUILD_FILE"
sed -i -E "s/versionName = \"[0-9]+\.[0-9]+\.[0-9]+\"/versionName = \"${new_name}\"/" "$BUILD_FILE"
echo "Version bumped to ${new_name} (${new_code})"