Skip to content

Commit ddb4aa7

Browse files
LukasModthymikee
andauthored
feat: adhoc upload step (#16)
* feat: adhoc upload step * Update action.yml --------- Co-authored-by: Michał Pierzchała <[email protected]>
1 parent c04be7b commit ddb4aa7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ inputs:
3434
re-sign:
3535
description: Re-sign the app bundle with new JS bundle
3636
required: false
37+
ad-hoc:
38+
description: 'Upload the APK with index.html page'
39+
required: false
40+
default: false
3741
keystore-base64:
3842
description: 'Base64 version of the release keystore'
3943
required: false
@@ -320,6 +324,15 @@ runs:
320324
echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV
321325
shell: bash
322326

327+
# For ad-hoc builds, the ARTIFACT_NAME may contain PR-number, while Rock will save the artifact without PR trait in its cache.
328+
# We need to upload the artifact with the PR-number in the name, that's why we use --binary-path with appropriate ARTIFACT_PATH that accounts for it.
329+
- name: Upload for Ad-hoc distribution
330+
if: ${{ env.PROVIDER_NAME != 'GitHub' && inputs.ad-hoc == 'true' }}
331+
run: |
332+
OUTPUT=$(npx rock remote-cache upload --name ${{ env.ARTIFACT_NAME }} --binary-path "${{ env.ARTIFACT_PATH }}" --json --ad-hoc) || (echo "$OUTPUT" && exit 1)
333+
echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV
334+
shell: bash
335+
323336
- name: Delete Old Re-Signed Artifacts
324337
if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' && github.event_name == 'pull_request' }}
325338
run: |

0 commit comments

Comments
 (0)