r0adkll/sign-android-release

[Question] How to retrieve a signed apk file?

X1nto opened this issue · 5 comments

X1nto commented

Hi, I tried using this action but unfortunately I can't locate the apk file that's produced on commit push.
Here's the .yml file:

name: Signed APK Builder

on:
  push:
    branches:
      - master
       
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Grant rights
        run: chmod +x ./gradlew

      - name: Build project with Gradle
        run: ./gradlew build

      - name: Build Release APK with Gradle
        run: ./gradlew assembleRelease

      - uses: r0adkll/sign-android-release@v1
        with:
          releaseDirectory: app/release
          signingKeyBase64: ${{ secrets.TOKEN }}
          alias: ${{ secrets.ALIAS }}
          keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}

Am I missing something? Should I create tags or do something else?

kceb commented

@X1nto

Utilize id and outputs. This step generates a signedReleaseFile output

    - name: Sign Android App
      id: sign-android-app
      uses: r0adkll/sign-android-release@v1
      with:
        releaseDirectory: ./android/app/build/outputs/apk/release/
        signingKeyBase64: ${{ secrets.APK_SIGNING_KEY }}
        alias: ${{ secrets.ALIAS }}
        keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
    - name: Other Step that accepts file as an input and uploads it somewhere
      with:
        file: ${{ steps.sign-android-app.outputs.signedReleaseFile }}

Look into github action outputs if you aren't able to get it working

X1nto commented

Thank you very much! I'll try to use the code as an example and build system on top of it, will report if anything goes wrong. Thanks again

X1nto commented

Hi again. I made it working using GitHub artifacts:

- name: Upload file to github 
  uses: actions/upload-artifact@v2 
  with: 
    name: 'app-release' 
    path: ${{ steps.sign-app.outputs.signedReleaseFile }}

I'm closing issue, thanks for your help

Any idea on the below erorr message?

Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
Download action repository 'actions/setup-java@v1'
Download action repository 'r0adkll/sign-android-release@v1'
Error: Could not find file '/home/runner/work/_actions/_temp_bdcf9596-e498-4a51-b469-05f96629b7b7/_staging/r0adkll-sign-android-release-6079bfc/node_modules/cross-spawn/node_modules/.bin/node-which'.

@omeryounus Please refer to issue #30 - I pushed v1.0.4 and updated v1 that should hopefully fix that issue.