I am trying to use a Github Workflow to build an Android app, but it requires a nonstandard development environment. Specifically, I need to use a file from https://github.com/Reginer/aosp-android-jar.
If I were doing this development manually, I would install Android Studio SDK on my PC, go through its resource files, and replace "android.jar" with the one I downloaded from that repo.
I tried to replicate these steps in a Workflow, but frankly I'm not very familiar with any of this and don't know if what I'm attempting is even possible. This is my (nonfunctional) workflow:
name: Android CI
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/actions/setup-gradle@v4
with:
dependency-graph: generate-and-submit
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Replace jar
shell: bash
run: |
pwd >> $GITHUB_STEP_SUMMARY
odir=$(pwd)
fpath=$(find . -type f -name 'android.jar')
echo $fpath >> $GITHUB_STEP_SUMMARY
cd ${fpath%/*}/
ls >> $GITHUB_STEP_SUMMARY
rm android.jar
curl -o https://github.com/Reginer/aosp-android-jar/raw/refs/heads/main/android-35/android.jar
cd $odir
- name: Build with Gradle
run: ./gradlew build
- name: Upload build reports
uses: actions/upload-artifact@v4
if: always()
with:
name: build-reports
path: build/reports/
File not foundandroid.jaryou want to replace? You don't needfind, you can just use the path directly.gradle/actions/setup-gradle@v4