Skip to content

Commit c80cb68

Browse files
authored
Support AAB
1 parent c04be7b commit c80cb68

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

action.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
description: 'Build variant'
2626
required: false
2727
default: 'debug'
28+
aab:
29+
description: 'Build Android App Bundle instead of APK'
30+
required: false
31+
default: false
2832
rock-build-extra-params:
2933
description: 'Extra parameters to pass to "rock build:android"'
3034
required: false
@@ -240,27 +244,28 @@ runs:
240244
run: |
241245
npx rock build:android \
242246
--variant "${{ inputs.variant }}" \
247+
${{ inputs.aab == 'true' && '--aab' || '' }} \
243248
${{ inputs.rock-build-extra-params }}
244249
shell: bash
245250
working-directory: ${{ inputs.working-directory }}
246251

247252
- name: Find Build Artifact
248253
if: ${{ !env.ARTIFACT_URL }}
249254
run: |
250-
APK_PATH=$(find $ANDROID_SOURCE_DIR/$APP_NAME/build/outputs -name '*.apk' | head -1 )
251-
echo APK_PATH $APK_PATH
252-
echo "ARTIFACT_PATH=$APK_PATH" >> $GITHUB_ENV
255+
BINARY_PATH=$(find $ANDROID_SOURCE_DIR/$APP_NAME/build/outputs -name '*.${{ inputs.aab == 'true' && 'aab' || 'apk' }}' | head -1 )
256+
echo BINARY_PATH $BINARY_PATH
257+
echo "ARTIFACT_PATH=$BINARY_PATH" >> $GITHUB_ENV
253258
shell: bash
254259

255-
- name: Download and Unpack APK
260+
- name: Download and Unpack Binary
256261
if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' }}
257262
run: |
258263
DOWNLOAD_OUTPUT=$(npx rock remote-cache download --name ${{ env.ARTIFACT_NAME }} --json) || (echo "$DOWNLOAD_OUTPUT" && exit 1)
259-
APK_PATH=$(echo "$DOWNLOAD_OUTPUT" | jq -r '.path')
260-
echo "ARTIFACT_PATH=$APK_PATH" >> $GITHUB_ENV
264+
BINARY_PATH=$(echo "$DOWNLOAD_OUTPUT" | jq -r '.path')
265+
echo "ARTIFACT_PATH=$BINARY_PATH" >> $GITHUB_ENV
261266
shell: bash
262267

263-
- name: Re-sign APK
268+
- name: Re-sign Binary
264269
if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' }}
265270
run: |
266271
npx rock sign:android ${{ env.ARTIFACT_PATH }} \
@@ -342,6 +347,6 @@ runs:
342347
if: ${{ github.event_name == 'pull_request' && inputs.comment-bot == 'true' }}
343348
uses: callstackincubator/android/.github/actions/rock-post-build@v3
344349
with:
345-
title: Android ${{ inputs.variant }} APK for all devices
350+
title: Android ${{ inputs.variant }} Binary for all devices
346351
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url || env.ARTIFACT_URL }}
347352
github-token: ${{ inputs.github-token }}

0 commit comments

Comments
 (0)