Bumps the actions-all group with 2 updates: [softprops/action-gh-release](https://github.com/softprops/action-gh-release) and [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action). Updates `softprops/action-gh-release` from 3.0.3 to 3.0.4 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/efb35369e0ad2afab669f228072c1b0d510eae64...8a0cd651e5b2365bd640854a3fa5dfc70e4875f3) Updates `SonarSource/sonarqube-scan-action` from 8.4.0 to 8.4.1 - [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases) - [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/4d1dc0c91ee400dcf8a6dddf2f705ac36542e304...e805d875275f728fac1885b413934be6d7c63f65) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: 3.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-all - dependency-name: SonarSource/sonarqube-scan-action dependency-version: 8.4.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-all ... Signed-off-by: dependabot[bot] <support@github.com>
165 lines
6.8 KiB
YAML
165 lines
6.8 KiB
YAML
name: Release Android App
|
|
|
|
# Builds a signed, universal release APK and attaches it to a (draft) GitHub
|
|
# Release. Triggered by pushing an `android-v*` tag, or manually.
|
|
#
|
|
# Required repo secrets (Settings → Secrets and variables → Actions):
|
|
# ANDROID_KEYSTORE_BASE64 base64 of the release keystore (.jks):
|
|
# `base64 -w0 release.jks` (Linux/macOS) or
|
|
# `[Convert]::ToBase64String([IO.File]::ReadAllBytes("release.jks"))` (PowerShell)
|
|
# ANDROID_KEYSTORE_PASSWORD store password
|
|
# ANDROID_KEY_ALIAS key alias
|
|
# ANDROID_KEY_PASSWORD key password
|
|
# Without these, the build can't sign and this workflow fails on purpose — an
|
|
# unsigned APK can't be installed. KEEP THE KEYSTORE + PASSWORDS BACKED UP:
|
|
# every future update must be signed with the SAME key or users must uninstall.
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'android-v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
# No default: a run rebuilds the tag it names and replaces that
|
|
# release's APK, so a stale default is one click from overwriting an
|
|
# old release.
|
|
description: 'Existing tag to build and release (e.g. android-v2.0.0)'
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# A manual run builds the tag it is releasing, not whatever main is at by
|
|
# then: a re-run after a CI-only fix must not ship newer app code under an
|
|
# older version's tag.
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
|
|
# The commit actually built. On a manual run `github.sha` is main's HEAD,
|
|
# not the tag checked out above.
|
|
- name: Record the source commit
|
|
id: source
|
|
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v6
|
|
with:
|
|
distribution: temurin
|
|
java-version: '17'
|
|
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '26'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
# Third-party actions are pinned to a commit (see release-desktop.yml).
|
|
- name: Install Rust toolchain + Android targets
|
|
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 (master)
|
|
with:
|
|
toolchain: stable
|
|
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
|
|
|
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
with:
|
|
workspaces: 'web/src-tauri -> target'
|
|
|
|
# platform-tools only. The action's default also installs the legacy
|
|
# `tools` package, which Google has removed from the SDK repository:
|
|
# `sdkmanager tools` fails with "Failed to find package 'tools'" and the
|
|
# whole release stops before building (android-v2.0.0, 2026-09-17).
|
|
# Gradle installs the build-tools and platform it needs on its own.
|
|
- name: Set up Android SDK
|
|
uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
|
|
with:
|
|
packages: platform-tools
|
|
log-accepted-android-sdk-licenses: false
|
|
|
|
- name: Set up Android NDK
|
|
id: setup-ndk
|
|
uses: nttld/setup-ndk@ed92fe6cadad69be94a966a7ee3271275e62f779 # v1.6.0
|
|
with:
|
|
ndk-version: r27
|
|
link-to-sdk: true
|
|
local-cache: true
|
|
|
|
- name: Export NDK_HOME
|
|
run: echo "NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV"
|
|
|
|
- name: Install web dependencies
|
|
working-directory: web
|
|
# Plain `npm ci`, as in web-ci.yml: build from the tested lockfile or
|
|
# not at all, and with no lifecycle scripts (web-ci.yml says why).
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Configure release keystore
|
|
working-directory: web/src-tauri/gen/android
|
|
env:
|
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
|
STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
|
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
|
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
run: |
|
|
if [ -z "$KEYSTORE_BASE64" ]; then
|
|
echo "::error::ANDROID_KEYSTORE_BASE64 secret is not set — cannot sign the release APK."
|
|
exit 1
|
|
fi
|
|
echo "$KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.jks"
|
|
# Guard against a truncated/corrupt base64 secret silently yielding
|
|
# an invalid keystore that fails opaquely later.
|
|
if [ "$(stat -c%s "$RUNNER_TEMP/release.jks")" -lt 1000 ]; then
|
|
echo "::error::Decoded keystore is suspiciously small — check the base64 secret."
|
|
exit 1
|
|
fi
|
|
{
|
|
echo "storeFile=$RUNNER_TEMP/release.jks"
|
|
echo "storePassword=$STORE_PASSWORD"
|
|
echo "keyAlias=$KEY_ALIAS"
|
|
echo "keyPassword=$KEY_PASSWORD"
|
|
} > keystore.properties
|
|
|
|
- name: Make gradlew executable
|
|
run: chmod +x web/src-tauri/gen/android/gradlew
|
|
|
|
- name: Build signed release APK
|
|
working-directory: web
|
|
# Universal APK (all 4 ABIs) — one file installs on any device. Swap to
|
|
# `--split-per-abi` if smaller per-architecture downloads are preferred.
|
|
run: npm run tauri -- android build --apk
|
|
|
|
- name: Publish APK to GitHub Release
|
|
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
|
|
with:
|
|
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
|
|
name: F2P Tracker Android ${{ github.event.inputs.tag || github.ref_name }}
|
|
draft: true
|
|
prerelease: false
|
|
fail_on_unmatched_files: true
|
|
files: web/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
|
|
body: |
|
|
Android build of the F2P Tracker — the same app as the desktop build
|
|
and https://free-steam-games.win, packaged as a sideloadable APK.
|
|
|
|
**Install**
|
|
1. Download `app-universal-release.apk`.
|
|
2. On your phone, allow "Install unknown apps" for your browser/file
|
|
manager when prompted, then open the APK.
|
|
3. Updates: install a newer APK over the top — same signing key, so no
|
|
uninstall needed.
|
|
|
|
**Requires Android 11 (API 30) or newer** — older devices are blocked
|
|
at install (`INSTALL_FAILED_OLDER_SDK`). Why this floor, the devices
|
|
it was chosen on and worldwide version stats: `docs/android-support.md`.
|
|
|
|
Reads its data from free-steam-games.win (`/api/data`) and keeps the
|
|
last verified copy for offline use; no telemetry. See
|
|
`docs/DISCLAIMER.md` for accuracy caveats.
|
|
|
|
Built from commit `${{ steps.source.outputs.sha }}`.
|