Skip to content

Merge branch 'main' into fdroid #1041

Merge branch 'main' into fdroid

Merge branch 'main' into fdroid #1041

Workflow file for this run

name: Build App
permissions:
contents: read
packages: read
on:
pull_request:
push:
branches:
- fdroid
- main
- release
jobs:
build:
name: Debug Build
runs-on: ubuntu-latest
container: ghcr.io/catfriend1/syncthing-android-builder
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Get app version from libs.versions.toml
id: get_version
run: |
set -eu
VERSION=$(grep 'version-name = ' gradle/libs.versions.toml | cut -d '"' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Get commit hash
id: get_commit_hash
run: |
set -eu
if [ "${{ github.event_name }}" = "pull_request" ]; then
COMMIT_HASH_LONG="${{ github.event.pull_request.head.sha }}"
else
COMMIT_HASH_LONG="${{ github.sha }}"
fi
COMMIT_HASH_SHORT=$(echo "$COMMIT_HASH_LONG" | cut -c1-7)
echo "COMMIT_HASH=${COMMIT_HASH_SHORT}" >> $GITHUB_ENV
- name: setup-debug-signing
run: |
set -eu
mkdir -p "/root/.android"
if [ -n "${{ secrets.DEBUG_KEYSTORE_B64 }}" ]; then
echo "Using TRUSTED debug.keystore for builds from branches corresponding to this repository"
echo '${{ secrets.DEBUG_KEYSTORE_B64 }}' | base64 -d > "/root/.android/debug.keystore"
else
cp "scripts/debug/debug.keystore.pub" "/root/.android/debug.keystore"
echo "Using UNTRUSTED PUBLIC debug.keystore for builds from forked repositories"
fi
- name: build
run: |
set -eu
git config --system --add safe.directory '*'
java -version
./gradlew --no-daemon buildNative lintDebug assembleDebug
- name: prepare-artifacts
shell: bash
run: |
set -eu
mv "app/build/outputs/apk/debug/app-debug.apk" "app/build/outputs/apk/debug/com.github.catfriend1.syncthingandroid_debug_v${{ env.VERSION }}_${{ env.COMMIT_HASH }}.apk"
- uses: actions/upload-artifact@v4
with:
name: com.github.catfriend1.syncthingandroid_debug_v${{ env.VERSION }}_${{ env.COMMIT_HASH }}.apk
path: app/build/outputs/apk/debug/com.github.catfriend1.syncthingandroid_debug_v${{ env.VERSION }}_${{ env.COMMIT_HASH }}.apk
- uses: actions/upload-artifact@v4
with:
name: reports
path: |
app/build/reports/**
- if: false
uses: actions/upload-artifact@v4
with:
name: reports-and-libs
path: |
app/build/reports/**
app/src/main/jniLibs/**