1

I'm trying to setup a Firebase Distrbution pipeline in Github Actions and I have the following check_and_deploy.yml:

  name: Android CI

on:
  push:
  #    tags:
  #      - 'v*'
  pull_request:
    branches:
      - main

jobs:
  test:
    name: unit-tests
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          distribution: 'temurin' # See 'Supported distributions' for available options
          java-version: '17'
      - name: Unit tests
        run: ./gradlew test --stacktrace

  build:
    name: build
    #    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      - name: set up JDK
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin' # See 'Supported distributions' for available options
          java-version: '17'
      - name: Generate Release APK
        run: ./gradlew assembleRelease
      - name: Sign APK
        uses: ilharp/sign-android-release@v1
        # ID used to access action output
        id: sign_app
        with:
          releaseDir: app/build/outputs/
          signingKey: ${{ secrets.SIGNING_KEY }}
          keyAlias: ${{ secrets.KEY_ALIAS }}
          keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
          keyPassword: ${{ secrets.KEY_PASSWORD }}
          buildToolsVersion: 33.0.0
      - uses: actions/upload-artifact@v3
        with:
          name: release.apk
          path: /home/runner/work/myapp/myapp
      - uses: actions/upload-artifact@v3
        with:
          name: mapping.txt
          path: app/build/outputs/mapping/release/mapping.txt

  deploy-firebase:
    needs: [ build ]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v3
        id: download
        with:
          name: release.apk
      - name: 'Echo download path'
        run: echo ${{steps.download.outputs.download-path}}
      - name: unzip downloaded APK
        run: unzip ${{steps.download.outputs.download-path}}/release.apk
      - name: upload artifact to Firebase App Distribution
        uses: wzieba/Firebase-Distribution-Github-Action@v1
        with:
          appId: ${{secrets.FIREBASE_APP_ID}}
          serviceCredentialsFileContent: ${{secrets.SERVICE_ACCOUNT}}
          groups: Testers
          file: app-release-unsigned-signed.apk

However, when it's being run in Github Actions I'm getting:

In the actions-download@v3 artifact:

Artifact release.apk was downloaded to /home/runner/work/myapp/myapp
Artifact download has finished successfully

But then during the unzip downloaded APK:

Run unzip /home/runner/work/myapp/myapp/release.apk
  unzip /home/runner/work/myapp/myapp/release.apk
  shell: /usr/bin/bash -e ***0***
unzip:  cannot find or open /home/runner/work/myapp/myapp/release.apk, /home/runner/work/myapp/myapp/release.apk.zip or /home/runner/work/myapp/myapp/release.apk.ZIP.
Error: Process completed with exit code 9.

Is there something I'm doing wrong here?

Thanks!

4
  • Is there actually a file named release.apk in the directory, has it the right size and are the folder permissions correctly set? Just for stating out the obvious :) Commented Jul 13, 2023 at 12:21
  • I don't think you can just unzip a SIGNED apk. Commented Jul 13, 2023 at 12:35
  • There's this artifact app-prod-release-unsigned-signed.apk which I tried to use but I'm getting the same error: ``` deploy-firebase: needs: [ build ] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 id: download with: name: app-prod-release-unsigned-signed.apk - name: unzip downloaded APK run: unzip app-prod-release-unsigned-signed.apk ``` Commented Jul 14, 2023 at 7:42
  • please try add run: | ls -al /home/runner/work/myapp/myapp pwd make sure the file is there and check the current working directory Commented Jan 3, 2024 at 1:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.