5 Commits

Author SHA1 Message Date
Hermes
cc2a16bf66 ci: broaden release asset upload token fallback
All checks were successful
Android build / build (push) Successful in 10m54s
Android build / build (release) Successful in 10m14s
2026-08-31 16:12:26 -05:00
Hermes
56a7103503 ci: bump APK versionCode and timestamp AAB names
Some checks failed
Android build / build (push) Successful in 15m22s
Android build / build (release) Failing after 12m34s
2026-08-31 15:06:03 -05:00
Hermes
f7722216a0 build: upgrade AGP for Android 16 support
All checks were successful
Android build / build (push) Successful in 16m36s
Android build / build (release) Successful in 13m37s
2026-08-31 13:31:01 -05:00
Hermes
8af42dbe48 build: target Android 16 / API 36
All checks were successful
Android build / build (push) Successful in 19m59s
2026-08-31 12:18:31 -05:00
Hermes
ebd7910b32 fix: resolve MindMachine release keystore path from repo root
All checks were successful
Android build / build (push) Successful in 11m29s
Android build / build (release) Successful in 11m56s
2026-08-29 14:03:23 -05:00
4 changed files with 51 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
name: Android build name: Android build
permissions: permissions:
contents: read contents: write
releases: write releases: write
on: on:
@@ -50,8 +50,8 @@ jobs:
set -o pipefail set -o pipefail
sdkmanager \ sdkmanager \
"platform-tools" \ "platform-tools" \
"platforms;android-35" \ "platforms;android-36" \
"build-tools;35.0.0" "build-tools;36.0.0"
- name: Prepare optional release signing - name: Prepare optional release signing
if: github.event_name == 'release' if: github.event_name == 'release'
@@ -96,6 +96,29 @@ jobs:
set -euxo pipefail set -euxo pipefail
printf 'sdk.dir=%s/.android/sdk\n' "$HOME" > local.properties printf 'sdk.dir=%s/.android/sdk\n' "$HOME" > local.properties
- name: Prepare CI build metadata
id: build_meta
shell: bash
run: |
set -euxo pipefail
timestamp_utc="$(date -u +%Y%m%d-%H%M%S)"
version_code="$(date -u +%s)"
project_name="$(basename "$GITHUB_REPOSITORY")"
python3 - "$version_code" <<'PY'
from pathlib import Path
import re, sys
path = Path('app/build.gradle.kts')
text = path.read_text(encoding='utf-8')
new_text, count = re.subn(r'(\bversionCode\s*=\s*)\d+', rf'\g<1>{sys.argv[1]}', text, count=1)
if count != 1:
raise SystemExit('versionCode not found in app/build.gradle.kts')
path.write_text(new_text, encoding='utf-8')
PY
echo "Using CI versionCode: $version_code"
echo "project_name=$project_name" >> "$GITHUB_OUTPUT"
echo "timestamp_utc=$timestamp_utc" >> "$GITHUB_OUTPUT"
echo "version_code=$version_code" >> "$GITHUB_OUTPUT"
- name: Build debug APK - name: Build debug APK
if: github.event_name != 'release' if: github.event_name != 'release'
shell: bash shell: bash
@@ -114,6 +137,18 @@ jobs:
export ANDROID_HOME="$ANDROID_SDK_ROOT" export ANDROID_HOME="$ANDROID_SDK_ROOT"
./gradlew --no-daemon bundleRelease ./gradlew --no-daemon bundleRelease
- name: Rename release AAB for upload
if: github.event_name == 'release'
id: release_aab
shell: bash
run: |
set -euxo pipefail
aab="$(find app/build/outputs/bundle/release -name '*.aab' | head -n 1)"
renamed="app/build/outputs/bundle/release/${{ steps.build_meta.outputs.project_name }}-${{ steps.build_meta.outputs.timestamp_utc }}-release.aab"
mv -f "$aab" "$renamed"
echo "Renamed release AAB to $(basename "$renamed")"
echo "path=$renamed" >> "$GITHUB_OUTPUT"
- name: Upload debug APK - name: Upload debug APK
if: github.event_name != 'release' if: github.event_name != 'release'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -126,13 +161,19 @@ jobs:
if: github.event_name == 'release' if: github.event_name == 'release'
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
shell: bash shell: bash
run: | run: |
set -euxo pipefail set -euxo pipefail
token="${GITEA_TOKEN:-${GITHUB_TOKEN:-}}"
if [ -z "$token" ]; then
echo "::error::No release upload token is available from secrets.GITEA_TOKEN or github.token"
exit 1
fi
release_id="$(python3 -c 'import json, os; print(json.load(open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8"))["release"]["id"])')" release_id="$(python3 -c 'import json, os; print(json.load(open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8"))["release"]["id"])')"
aab="$(find app/build/outputs/bundle/release -name '*.aab' | head -n 1)" aab="${{ steps.release_aab.outputs.path }}"
curl --fail-with-body \ curl --fail-with-body \
--request POST \ --request POST \
--header "Authorization: token ${GITEA_TOKEN}" \ --header "Authorization: token ${token}" \
--form "attachment=@${aab}" \ --form "attachment=@${aab}" \
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=$(basename "$aab")" "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=$(basename "$aab")"

View File

@@ -21,12 +21,12 @@ val hasReleaseSigning = listOf(
android { android {
namespace = "solutions.tretter.mindmachine" namespace = "solutions.tretter.mindmachine"
compileSdk = 35 compileSdk = 36
defaultConfig { defaultConfig {
applicationId = "solutions.tretter.mindmachine" applicationId = "solutions.tretter.mindmachine"
minSdk = 26 minSdk = 26
targetSdk = 35 targetSdk = 36
versionCode = 18 versionCode = 18
versionName = "1.0.13" versionName = "1.0.13"
@@ -36,7 +36,7 @@ android {
signingConfigs { signingConfigs {
if (hasReleaseSigning) { if (hasReleaseSigning) {
create("release") { create("release") {
storeFile = file(keystoreProperties.getProperty("storeFile")) storeFile = rootProject.file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword") storePassword = keystoreProperties.getProperty("storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias") keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword") keyPassword = keystoreProperties.getProperty("keyPassword")

View File

@@ -1,5 +1,5 @@
plugins { plugins {
id("com.android.application") version "8.5.2" apply false id("com.android.application") version "8.10.0" apply false
id("org.jetbrains.kotlin.android") version "2.1.0" apply false id("org.jetbrains.kotlin.android") version "2.1.0" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.0" apply false id("org.jetbrains.kotlin.plugin.serialization") version "2.1.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME