feat: add prefab and maven publish support #123
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build jsc-android and test | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🔨 Use JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: ⬢ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install coreutils curl git wget python3 ruby gperf -y | |
shell: bash | |
- name: Install Android packages | |
run: | | |
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools | |
yes | sdkmanager --licenses || true | |
sdkmanager \ | |
"cmake;3.22.1" \ | |
"ndk;27.1.12297006" | |
# move out builtin icu headers from ndk and prevent icu build errors | |
mv "${ANDROID_HOME}/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/unicode" "${ANDROID_HOME}/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/unicode2" | |
echo "ANDROID_NDK=$ANDROID_HOME/ndk/27.1.12297006" >> $GITHUB_ENV | |
echo "PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools" >> $GITHUB_ENV | |
shell: bash | |
- name: Build | |
run: | | |
yarn install --frozen-lockfile | |
yarn clean | |
yarn download | |
yarn start | |
shell: bash | |
- name: Archive | |
run: | | |
mkdir -p archive | |
mv dist archive/ | |
mv dist.unstripped archive/ | |
shell: bash | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: archive | |
path: archive | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🧹 Cleanup GitHub Linux runner disk space | |
uses: ./.github/actions/cleanup-linux-disk-space | |
- name: ⬢ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: 🔨 Use JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: archive | |
path: archive | |
- name: Extract archive | |
run: | | |
mv archive/dist dist | |
mv archive/dist.unstripped dist.unstripped | |
rmdir archive | |
find dist | |
find dist.unstripped | |
shell: bash | |
- name: 🍺 Install Maestro | |
run: | | |
curl -Ls "https://get.maestro.mobile.dev" | bash | |
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
- name: Install node packages | |
run: yarn install --frozen-lockfile | |
working-directory: test | |
- name: ⚙️ Enable KVM for Android virtualization | |
shell: bash | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Run test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 24 | |
arch: x86_64 | |
target: google_apis | |
working-directory: test | |
script: | | |
npx expo run:android --variant release --no-bundler | |
adb logcat -c | |
set +e | |
maestro test maestro.yaml | |
STATUS=$? | |
adb logcat -d > adb.log | |
exit $STATUS | |
- name: Upload failed artifacts | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: failure_artifacts | |
path: | | |
$HOME/.maestro/tests/**/* | |
test/android/app/build/outputs/apk/release/app-release.apk | |
test/adb.log |