Skip to content

Add Build Output To Release #17

Add Build Output To Release

Add Build Output To Release #17

name: Add Build Output To Release
on:
workflow_dispatch:
inputs:
artifactUrl:
description: Artifact URL - The URL of the build artifact hosted on EAS. From the build payload result this is `artifacts.buildUrl` (if the build is successful.)
required: true
type: string
appVersion:
description: App Version - The "version name" aka "marketing version" of the app. It should match an already existing release.
required: true
type: string
jobs:
download_eas_build:
runs-on: ubuntu-latest
environment: production
name: Download EAS Build and Add To Release
permissions:
contents: read
steps:
- name: Run cURL script to download
run: |
curl -sSL ${{ inputs.artifactUrl }} -o ${{ inputs.appVersion }}.aab
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aab-file
path: ${{ inputs.appVersion }}.aab
retention-days: 1
create_and_upload_artifacts:
runs-on: ubuntu-latest
environment: production
needs: [download_eas_build]
name: Create and Upload Artifacts
permissions:
contents: write
steps:
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Setup Bundletool
uses: amyu/setup-bundletool@v1
- name: Get AAB Artifact
uses: actions/download-artifact@v4
with:
name: aab-file
- name: Create Keystore
run: echo -n ${{ secrets.APP_JKS }} | base64 --decode > signingKey.jks
- name: Build APKs from AAB
run: "bundletool build-apks --bundle=${{ inputs.appVersion }}.aab --output temp.apks --ks=signingKey.jks --ks-pass=pass:${{ secrets.APP_KS_PWD }} --ks-key-alias=${{ secrets.APP_KS_KEY_ALS }} --key-pass=pass:${{ secrets.APP_KS_KEY_PWD }} --mode=universal"
- name: Unzip APKs and Rename Inner APK
run: unzip temp.apks && mv universal.apk ${{ inputs.appVersion }}.apk
- name: Add Build To Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.appVersion }}
files: |
${{ inputs.appVersion }}.aab
${{ inputs.appVersion }}.apk