50 lines
1.7 KiB
YAML
50 lines
1.7 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
assemble-debug:
|
|
name: Assemble debug APK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Checkout: clone the repo directly instead of actions/checkout
|
|
- name: Checkout
|
|
run: |
|
|
git clone https://git.trevena.info/nick/incido.git repo
|
|
cd repo
|
|
|
|
# Set up JDK 17: download and extract directly (no apt-get, no root needed)
|
|
- name: Set up JDK 17
|
|
run: |
|
|
# Install JDK into the runner's working dir (persists across runs, no root needed)
|
|
WORKDIR=/tmp/gitea-runner-work
|
|
if [ ! -d "$WORKDIR/jdk" ]; then
|
|
wget -q 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz' -O /tmp/jdk.tar.gz
|
|
mkdir -p "$WORKDIR/jdk"
|
|
tar -xzf /tmp/jdk.tar.gz -C "$WORKDIR/jdk" --strip-components=1
|
|
rm /tmp/jdk.tar.gz
|
|
fi
|
|
echo "JAVA_HOME=$WORKDIR/jdk" >> $GITHUB_ENV
|
|
echo "PATH=$WORKDIR/jdk/bin:$PATH" >> $GITHUB_ENV
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x repo/gradlew
|
|
|
|
- name: Cache Gradle packages
|
|
run: |
|
|
mkdir -p ~/.gradle/caches ~/.gradle/wrapper
|
|
# Copy cached gradle wrapper if available
|
|
if [ -d .github/workflows/gradle-cache ]; then
|
|
cp -r .github/workflows/gradle-cache/* ~/.gradle/ 2>/dev/null || true
|
|
fi
|
|
|
|
- name: Build debug APK
|
|
run: cd repo && ./gradlew assembleDebug
|
|
|
|
# Note: artifact upload requires Docker or Gitea's native actions
|
|
# Skipping artifact upload — download APK from runner workspace if needed
|