diff --git a/action.yml b/action.yml index 9f9d52c..81878fe 100644 --- a/action.yml +++ b/action.yml @@ -34,6 +34,10 @@ inputs: re-sign: description: Re-sign the app bundle with new JS bundle required: false + ad-hoc: + description: 'Upload the APK with index.html page' + required: false + default: false keystore-base64: description: 'Base64 version of the release keystore' required: false @@ -320,6 +324,15 @@ runs: echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV shell: bash + # For ad-hoc builds, the ARTIFACT_NAME may contain PR-number, while Rock will save the artifact without PR trait in its cache. + # 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. + - name: Upload for Ad-hoc distribution + if: ${{ env.PROVIDER_NAME != 'GitHub' && inputs.ad-hoc == 'true' }} + run: | + OUTPUT=$(npx rock remote-cache upload --name ${{ env.ARTIFACT_NAME }} --binary-path "${{ env.ARTIFACT_PATH }}" --json --ad-hoc) || (echo "$OUTPUT" && exit 1) + echo "ARTIFACT_URL=$(echo "$OUTPUT" | jq -r '.url')" >> $GITHUB_ENV + shell: bash + - name: Delete Old Re-Signed Artifacts if: ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' && github.event_name == 'pull_request' }} run: |