ci(android): add Forgejo Actions workflows for debug APK builds
Adds .forgejo/workflows/ with two workflows that run on the self-hosted vega-runner (Forgejo act_runner with Nix support): - build-fdroid-debug.yml: builds fdroidDebug variant (no Firebase) - build-play-debug.yml: builds playDebug variant (with Firebase) Both install the Android SDK via command-line tools, set up JDK 21, cache Gradle, build the APK, and upload artifacts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
69a40023e9
commit
19201cf251
2 changed files with 124 additions and 0 deletions
62
.forgejo/workflows/build-fdroid-debug.yml
Normal file
62
.forgejo/workflows/build-fdroid-debug.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
name: Build F-Droid Debug APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'app/**'
|
||||||
|
- '.forgejo/workflows/build-fdroid-debug.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'app/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install Android SDK
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
export ANDROID_HOME=$HOME/android-sdk
|
||||||
|
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
||||||
|
mkdir -p $ANDROID_HOME/cmdline-tools
|
||||||
|
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o /tmp/cmdline-tools.zip
|
||||||
|
unzip -q /tmp/cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools
|
||||||
|
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
|
||||||
|
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
|
||||||
|
yes | sdkmanager --licenses >/dev/null 2>&1 || true
|
||||||
|
sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '21'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Cache Gradle
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: ${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Build F-Droid Debug APK
|
||||||
|
run: ./gradlew :app:assembleFdroidDebug --no-daemon --stacktrace
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: centralcloud-oncall-fdroid-debug-${{ github.run_id }}
|
||||||
|
path: app/build/outputs/apk/fdroid/debug/*.apk
|
||||||
62
.forgejo/workflows/build-play-debug.yml
Normal file
62
.forgejo/workflows/build-play-debug.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
name: Build Play Debug APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'app/**'
|
||||||
|
- '.forgejo/workflows/build-play-debug.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'app/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install Android SDK
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
export ANDROID_HOME=$HOME/android-sdk
|
||||||
|
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
||||||
|
mkdir -p $ANDROID_HOME/cmdline-tools
|
||||||
|
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o /tmp/cmdline-tools.zip
|
||||||
|
unzip -q /tmp/cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools
|
||||||
|
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
|
||||||
|
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
|
||||||
|
yes | sdkmanager --licenses >/dev/null 2>&1 || true
|
||||||
|
sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '21'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Cache Gradle
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: ${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Build Play Debug APK
|
||||||
|
run: ./gradlew :app:assemblePlayDebug --no-daemon --stacktrace
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: centralcloud-oncall-play-debug
|
||||||
|
path: app/build/outputs/apk/play/debug/*.apk
|
||||||
Loading…
Add table
Reference in a new issue