ci: run the GitHub builds in the nix devshell

Drop setup-java, setup-android and the Gradle wrapper in favour of the
flake's pinned JDK, Gradle and Android SDK, restoring the Nix store with
cache-nix-action, so the release and next builds share the dev toolchain.
This commit is contained in:
austinried
2026-10-08 18:52:43 +00:00
parent 23911fceb5
commit c76a79c3ed
2 changed files with 16 additions and 22 deletions
+8 -11
View File
@@ -7,25 +7,22 @@ on:
permissions:
contents: read
env:
NIX_CONFIG: experimental-features = nix-command flakes
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
- uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7
with:
distribution: temurin
java-version: "21"
- name: Set up Android SDK
uses: android-actions/setup-android@v4
- name: Install platform and build tools
run: sdkmanager "platforms;android-37" "build-tools;37.0.0"
primary-key: nix-v2-${{ hashFiles('flake.lock', '**/*.nix') }}
restore-prefixes-first-match: nix-v2-
- name: Build next builds
run: |
chmod +x gradlew
./gradlew :app:assembleDebug :app:assembleNext --no-daemon
run: nix develop --command gradle :app:assembleDebug :app:assembleNext --no-daemon
- name: Collect next builds
run: |
cp app/build/outputs/apk/debug/app-debug.apk subtracks-next-debug.apk