@quiet/desktop@7.1.0-alpha.9 #1278
Workflow file for this run
This file contains hidden or 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 Android Package Kit | |
| on: | |
| release: | |
| types: [prereleased, released] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| jobs: | |
| build-prod-apk: | |
| # needs: detox-android | |
| runs-on: ${{ matrix.os }} | |
| if: | | |
| startsWith(github.ref, 'refs/tags/@quiet/mobile') | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04] | |
| steps: | |
| - name: "Print OS" | |
| run: echo ${{ matrix.os }} | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: false | |
| - name: "Init submodules except 3rd-party/qss" | |
| run: git submodule update --init --recursive --depth 1 --jobs 8 -- ":(exclude)3rd-party/qss" | |
| - name: Extract version | |
| id: extract_version | |
| uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 | |
| with: | |
| path: packages/mobile | |
| - name: "Reclaim disk space" | |
| run: | | |
| set -euxo pipefail | |
| echo "=== Disk usage before cleanup ===" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}/CodeQL" | |
| sudo rm -rf /usr/local/lib/android/sdk/{system-images,emulator,ndk} | |
| echo "=== Disk usage after cleanup ===" | |
| df -h | |
| - name: "Set up JDK" | |
| uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: "Set up NDK" | |
| uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # v1.5.0 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r28c | |
| add-to-path: false | |
| - name: "Setup environment" | |
| 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,@quiet/node-common" | |
| - name: "Create gradle configuration directory" | |
| run: mkdir -p $HOME/.gradle | |
| - name: "Prepare ndk configuration" | |
| run: | | |
| printf "\ | |
| NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n\ | |
| " > $HOME/.gradle/gradle.properties | |
| - name: "Prepare signing configuration" | |
| 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" | |
| run: echo ${{ SECRETS.GOOGLE_KEYSTORE }} | base64 --decode > ./packages/mobile/android/app/quietmobile.keystore | |
| - name: "Build .apk" | |
| run: cd ./packages/mobile/android && ENVFILE=../.env.production ./gradlew assembleStandardRelease | |
| - name: "Upload .apk to artifacts" | |
| continue-on-error: true | |
| uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
| with: | |
| name: app-standard-release.apk | |
| path: ./packages/mobile/android/app/build/outputs/apk/standard/release/app-standard-release.apk | |
| - name: "Build debug .apk" | |
| run: cd ./packages/mobile/android && ENVFILE=../.env.production ./gradlew assembleStandardDebug | |
| - name: "Upload debug .apk to artifacts" | |
| continue-on-error: true | |
| uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
| with: | |
| name: app-standard-debug.apk | |
| path: ./packages/mobile/android/app/build/outputs/apk/standard/debug/app-standard-debug.apk | |
| - name: "Get release" | |
| id: get_release | |
| uses: bruceadams/get-release@v1.2.3 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: "Upload release assets" | |
| uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.get_release.outputs.upload_url }} | |
| asset_path: ./packages/mobile/android/app/build/outputs/apk/standard/release/app-standard-release.apk | |
| asset_name: app-standard-release.apk | |
| asset_content_type: application/.apk | |
| - name: "Upload debug release assets" | |
| uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ steps.get_release.outputs.upload_url }} | |
| asset_path: ./packages/mobile/android/app/build/outputs/apk/standard/debug/app-standard-debug.apk | |
| asset_name: app-standard-debug.apk | |
| asset_content_type: application/.apk | |
| - name: Send Release Notificaton | |
| uses: ./.github/actions/release-notifier | |
| if: always() | |
| with: | |
| os-name: Android (APK) | |
| version: ${{ steps.extract_version.outputs.version }} | |
| status: ${{ job.status }} | |
| slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} | |
| build-debug-apk: | |
| if: | | |
| (github.event_name == 'pull_request' && github.event.pull_request.draft == false) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: false | |
| - name: "Init submodules except 3rd-party/qss" | |
| run: git submodule update --init --recursive --depth 1 --jobs 8 -- ":(exclude)3rd-party/qss" | |
| - name: "Reclaim disk space" | |
| run: | | |
| set -euxo pipefail | |
| echo "=== Disk usage before cleanup ===" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}/CodeQL" | |
| sudo rm -rf /usr/local/lib/android/sdk/{system-images,emulator,ndk} | |
| echo "=== Disk usage after cleanup ===" | |
| df -h | |
| - name: "Set up JDK" | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: "Set up NDK" | |
| uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # v1.5.0 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r28c | |
| add-to-path: false | |
| - name: "Setup environment" | |
| 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,@quiet/node-common" | |
| cachePrefix: "mobile-debug-apk" | |
| - name: "Create gradle configuration directory" | |
| run: mkdir -p $HOME/.gradle | |
| - name: "Prepare ndk configuration" | |
| run: | | |
| printf "NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n" > $HOME/.gradle/gradle.properties | |
| - name: "Build debug .apk" | |
| run: cd ./packages/mobile/android && ENVFILE=../.env.staging ./gradlew assembleStandardDebug | |
| - name: Get branch name | |
| id: branch | |
| shell: bash | |
| run: | | |
| B_NAME=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's|/|-|g') | |
| echo "branch_name=$B_NAME" >> $GITHUB_OUTPUT | |
| echo "BRANCH_NAME=$B_NAME" >> $GITHUB_ENV | |
| - name: "Upload debug .apk to artifacts" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Quiet-APK-${{steps.branch.outputs.branch_name}}-${{ github.event.pull_request.head.sha || github.sha }} | |
| path: ./packages/mobile/android/app/build/outputs/apk/standard/debug/app-standard-debug.apk |