-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test android build and better filtering on testing ios build
- Loading branch information
1 parent
6e47f6f
commit 5f23422
Showing
2 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Test Android Build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
test-build-android: | ||
# needs: detox-android | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest-m] | ||
|
||
steps: | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
mobile: | ||
- 'packages/mobile/**' | ||
- 'packages/backend/**' | ||
- 'packages/common/**' | ||
- 'packages/helia/**' | ||
- 'packages/identity/**' | ||
- 'packages/logger/**' | ||
- 'packages/state-manager/**' | ||
- 'packages/types/**' | ||
- name: "Skip tests" | ||
if: steps.filter.outputs.mobile == 'false' | ||
run: | | ||
echo "Skipping test run" | ||
exit 0 | ||
- name: "Print OS" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: echo ${{ matrix.os }} | ||
|
||
- uses: actions/checkout@v4 | ||
if: steps.filter.outputs.mobile == 'true' | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: "Set up JDK" | ||
if: steps.filter.outputs.mobile == 'true' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
|
||
- name: "Set up NDK" | ||
if: steps.filter.outputs.mobile == 'true' | ||
uses: nttld/setup-ndk@v1 | ||
id: setup-ndk | ||
with: | ||
ndk-version: r25b | ||
add-to-path: false | ||
|
||
- name: "Install Bundletool" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: | | ||
wget https://github.com/google/bundletool/releases/download/1.15.6/bundletool-all-1.15.6.jar -O /usr/local/bin/bundletool.jar | ||
- name: "Setup environment" | ||
if: steps.filter.outputs.mobile == 'true' | ||
uses: ./.github/actions/setup-env | ||
with: | ||
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle,helia" | ||
|
||
- name: "Create gradle configuration directory" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: mkdir -p $HOME/.gradle | ||
|
||
- name: "Prepare ndk configuration" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: | | ||
printf "\ | ||
NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n\ | ||
" > $HOME/.gradle/gradle.properties | ||
- name: "Prepare signing configuration" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: | | ||
printf "\ | ||
STORE_FILE=quietmobile.keystore\n\ | ||
STORE_PASSWORD=${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }}\n\ | ||
KEY_ALIAS=${{ SECRETS.GOOGLE_KEYSTORE_ALIAS }}\n\ | ||
KEY_PASSWORD=${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }}\ | ||
" >> $HOME/.gradle/gradle.properties | ||
- name: "Decode keystore" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: echo ${{ SECRETS.GOOGLE_KEYSTORE }} | base64 --decode > ./packages/mobile/android/app/quietmobile.keystore | ||
|
||
- name: "Build .aab" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: cd ./packages/mobile/android && ENVFILE=../.env.staging ./gradlew bundleStandardRelease | ||
|
||
- name: "Build .apks" | ||
if: steps.filter.outputs.mobile == 'true' | ||
run: | | ||
java -jar /usr/local/bin/bundletool.jar build-apks \ | ||
--bundle=./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.aab \ | ||
--output=./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.apks \ | ||
--ks=./packages/mobile/android/app/quietmobile.keystore \ | ||
--ks-pass=pass:${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }} \ | ||
--ks-key-alias=${{ SECRETS.GOOGLE_KEYSTORE_ALIAS }} | ||
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