GithubHelp home page GithubHelp logo

rankarusu / sign-android-release Goto Github PK

View Code? Open in Web Editor NEW

This project forked from r0adkll/sign-android-release

0.0 0.0 0.0 34.46 MB

A GitHub action to sign an APK or AAB

License: MIT License

Shell 0.43% JavaScript 61.22% TypeScript 38.35%

sign-android-release's Introduction

Sign Android Release Action

This action will help you sign an Android .apk or .aab (Android App Bundle) file for release. This is a fork of r0adkll/sign-android-release. The original sadly has not been updated for a while and will stop working once the github actions servers stop supporting node12. I just forked it to get an action with updated dependencies.

Inputs

releaseDirectory

Required: The relative directory path in your project where your Android release file will be located

signingKeyBase64

Required: The base64 encoded signing key used to sign your app

This action will directly decode this input to a file to sign your release with. You can prepare your key by running this command on *nix systems.

openssl base64 < some_signing_key.jks | tr -d '\n' | tee some_signing_key.jks.base64.txt

Then copy the contents of the .txt file to your GH secrets

alias

Required: The alias of your signing key

keyStorePassword

Required: The password to your signing keystore

keyPassword

Optional: The private key password for your signing keystore

ENV: BUILD_TOOLS_VERSION

Optional: You can manually specify a version of build-tools to use. We use 34.0.0 by default.

Outputs

Output variables are set both locally and in environment variables.

signedReleaseFile/ ENV: SIGNED_RELEASE_FILE

The path to the single release file that have been signed with this action. Not set if several release files have been signed.

signedReleaseFiles / ENV: SIGNED_RELEASE_FILES

The paths to the release files that have been signed with this action, separated by :.

Example usage

Single APK

The output variable signedReleaseFile can be used in a release action.

steps:
  - uses: r0adkll/sign-android-release@v1
    name: Sign app APK
    # ID used to access action output
    id: sign_app
    with:
      releaseDirectory: app/build/outputs/apk/release
      signingKeyBase64: ${{ secrets.SIGNING_KEY }}
      alias: ${{ secrets.ALIAS }}
      keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
      keyPassword: ${{ secrets.KEY_PASSWORD }}
    env:
      # override default build-tools version (33.0.0) -- optional
      BUILD_TOOLS_VERSION: "34.0.0"

  # Example use of `signedReleaseFile` output -- not needed
  - uses: actions/upload-artifact@v2
    with:
      name: Signed app bundle
      path: ${{steps.sign_app.outputs.signedReleaseFile}}

Multiple APKs, multiple variables

The output variables signedReleaseFileX can be used to refer to each signed release file.

steps:
  - uses: r0adkll/sign-android-release@v1
    id: sign_app
    with:
      releaseDirectory: app/build/outputs/apk/release
      signingKeyBase64: ${{ secrets.SIGNING_KEY }}
      alias: ${{ secrets.ALIAS }}
      keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
      keyPassword: ${{ secrets.KEY_PASSWORD }}

  - name: Example Release
    uses: "marvinpinto/action-automatic-releases@latest"
    with:
      repo_token: "${{ secrets.GITHUB_TOKEN }}"
      automatic_release_tag: "latest"
      prerelease: true
      title: "Release X"
      files: |
        ${{ steps.sign_app.signedReleaseFile0 }}
        ${{ steps.sign_app.signedReleaseFile1 }}
        ${{ steps.sign_app.signedReleaseFile2 }}
        ${{ steps.sign_app.signedReleaseFile3 }}
        ${{ steps.sign_app.signedReleaseFile4 }}

Multiple APKs, single variable

The output variable signedReleaseFiles must be split first, before being used in a release action.

steps:
  - uses: r0adkll/sign-android-release@v1
    id: sign_app
    with:
      releaseDirectory: app/build/outputs/apk/release
      signingKeyBase64: ${{ secrets.SIGNING_KEY }}
      alias: ${{ secrets.ALIAS }}
      keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
      keyPassword: ${{ secrets.KEY_PASSWORD }}

  - uses: jungwinter/split@v1
    id: signed_files
    with:
      msg: ${{ steps.sign_app.signedReleaseFiles }}
      separator: ':'

  - name: Example Release
    uses: "marvinpinto/action-automatic-releases@latest"
    with:
      repo_token: "${{ secrets.GITHUB_TOKEN }}"
      automatic_release_tag: "latest"
      prerelease: true
      title: "Release X"
      files: |
        ${{ steps.signed_files._0 }}
        ${{ steps.signed_files._1 }}
        ${{ steps.signed_files._2 }}
        ${{ steps.signed_files._3 }}
        ${{ steps.signed_files._4 }}

sign-android-release's People

Contributors

r0adkll avatar davwheat avatar rankarusu avatar dependabot[bot] avatar jobobby04 avatar abushawish avatar tiann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.