From a6607bac1061ecdd676e5077ae0022baae94a5b7 Mon Sep 17 00:00:00 2001 From: Tomasz Lesniakiewicz Date: Fri, 3 Oct 2025 12:39:49 +0200 Subject: [PATCH 1/4] feat: add keystore-path param --- action.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 0049ad0..44e1e40 100644 --- a/action.yml +++ b/action.yml @@ -52,6 +52,10 @@ inputs: keystore-key-password: description: 'Keystore key password' required: false + keystore-path: + description: 'Path within the Android source directory where the keystore should be placed' + required: false + default: 'release.keystore' comment-bot: description: 'Whether to send a comment under PR with the link to the generated build' required: false @@ -200,10 +204,12 @@ runs: - name: Decode and store keystore file if: ${{ !env.ARTIFACT_URL && inputs.sign }} run: | + KEYSTORE_TARGET_PATH="$ANDROID_SOURCE_DIR/$APP_NAME/${{ inputs.keystore-path }}" + mkdir -p "$(dirname "$KEYSTORE_TARGET_PATH")" if [ -n "${{ inputs.keystore-file }}" ]; then - cp "${{ inputs.keystore-file }}" $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore + cp "${{ inputs.keystore-file }}" "$KEYSTORE_TARGET_PATH" else - echo "${{ inputs.keystore-base64 }}" | base64 --decode > $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore + echo "${{ inputs.keystore-base64 }}" | base64 --decode > "$KEYSTORE_TARGET_PATH" fi shell: bash working-directory: ${{ inputs.working-directory }} @@ -303,7 +309,7 @@ runs: if: ${{ !env.ARTIFACT_URL && inputs.sign }} run: | rm $HOME/.gradle/gradle.properties - rm $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore + rm "$ANDROID_SOURCE_DIR/$APP_NAME/${{ inputs.keystore-path }}" shell: bash working-directory: ${{ inputs.working-directory }} From feb32b565e0bc9cdf9aa47ea7458d57925861258 Mon Sep 17 00:00:00 2001 From: Tomasz Lesniakiewicz Date: Fri, 3 Oct 2025 12:40:28 +0200 Subject: [PATCH 2/4] docs: add keystore-path info --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 202bcbc..5cfbb29 100644 --- a/README.md +++ b/README.md @@ -43,27 +43,29 @@ jobs: # keystore-store-password: ${{ secrets.KEYSTORE_STORE_PASSWORD }} # keystore-key-alias: 'your-key-alias' # keystore-key-password: ${{ secrets.KEYSTORE_KEY_PASSWORD }} + # keystore-path: 'tools/buildtools/upload-key.keystore' # Optional: custom keystore path ``` ## Inputs -| Input | Description | Required | Default | -| ------------------------- | ---------------------------------------- | -------- | ------- | -| `github-token` | GitHub Token | Yes | - | -| `working-directory` | Working directory for the build command | No | `.` | -| `validate-gradle-wrapper` | Whether to validate the Gradle wrapper | No | `true` | -| `setup-java` | Whether to run actions/setup-java action | No | `true` | -| `variant` | Build variant (debug/release) | No | `debug` | -| `sign` | Whether to sign the build with keystore | No | - | -| `re-sign` | Re-sign the APK with new JS bundle | No | `false` | -| `keystore-file` | Path to the keystore file | No | - | -| `keystore-base64` | Base64 encoded keystore file | No | - | -| `keystore-store-file` | Keystore store file name | No | - | -| `keystore-store-password` | Keystore store password | No | - | -| `keystore-key-alias` | Keystore key alias | No | - | -| `keystore-key-password` | Keystore key password | No | - | -| `rock-build-extra-params` | Extra parameters for rock build:android | No | - | -| `comment-bot` | Whether to comment PR with build link | No | `true` | +| Input | Description | Required | Default | +| ------------------------- | ---------------------------------------- | -------- | ------------------ | +| `github-token` | GitHub Token | Yes | - | +| `working-directory` | Working directory for the build command | No | `.` | +| `validate-gradle-wrapper` | Whether to validate the Gradle wrapper | No | `true` | +| `setup-java` | Whether to run actions/setup-java action | No | `true` | +| `variant` | Build variant (debug/release) | No | `debug` | +| `sign` | Whether to sign the build with keystore | No | - | +| `re-sign` | Re-sign the APK with new JS bundle | No | `false` | +| `keystore-file` | Path to the keystore file | No | - | +| `keystore-base64` | Base64 encoded keystore file | No | - | +| `keystore-store-file` | Keystore store file name | No | - | +| `keystore-store-password` | Keystore store password | No | - | +| `keystore-key-alias` | Keystore key alias | No | - | +| `keystore-key-password` | Keystore key password | No | - | +| `keystore-path` | Path for keystore | No | `release.keystore` | +| `rock-build-extra-params` | Extra parameters for rock build:android | No | - | +| `comment-bot` | Whether to comment PR with build link | No | `true` | ## Outputs From b3700e4d08d90dbbce12a6c638099f52ba47d03b Mon Sep 17 00:00:00 2001 From: Tomasz Lesniakiewicz Date: Fri, 3 Oct 2025 12:48:35 +0200 Subject: [PATCH 3/4] chore: additional error handling --- README.md | 2 +- action.yml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cfbb29..aa3edf7 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ jobs: # keystore-store-password: ${{ secrets.KEYSTORE_STORE_PASSWORD }} # keystore-key-alias: 'your-key-alias' # keystore-key-password: ${{ secrets.KEYSTORE_KEY_PASSWORD }} - # keystore-path: 'tools/buildtools/upload-key.keystore' # Optional: custom keystore path + # keystore-path: 'tools/buildtools/upload-key.keystore' # Optional: for custom keystore locations ``` ## Inputs diff --git a/action.yml b/action.yml index 44e1e40..3f9d1b5 100644 --- a/action.yml +++ b/action.yml @@ -205,7 +205,10 @@ runs: if: ${{ !env.ARTIFACT_URL && inputs.sign }} run: | KEYSTORE_TARGET_PATH="$ANDROID_SOURCE_DIR/$APP_NAME/${{ inputs.keystore-path }}" - mkdir -p "$(dirname "$KEYSTORE_TARGET_PATH")" + mkdir -p "$(dirname "$KEYSTORE_TARGET_PATH")" || { + echo "Failed to create keystore directory: $(dirname "$KEYSTORE_TARGET_PATH")" + exit 1 + } if [ -n "${{ inputs.keystore-file }}" ]; then cp "${{ inputs.keystore-file }}" "$KEYSTORE_TARGET_PATH" else From e746b3dc056a5e057428a29973a448b1f9450a71 Mon Sep 17 00:00:00 2001 From: Tomasz Lesniakiewicz Date: Fri, 3 Oct 2025 14:45:47 +0200 Subject: [PATCH 4/4] docs: add keystore-path info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa3edf7..d12b54e 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ jobs: | `keystore-store-password` | Keystore store password | No | - | | `keystore-key-alias` | Keystore key alias | No | - | | `keystore-key-password` | Keystore key password | No | - | -| `keystore-path` | Path for keystore | No | `release.keystore` | +| `keystore-path` | where the keystore should be placed | No | `release.keystore` | | `rock-build-extra-params` | Extra parameters for rock build:android | No | - | | `comment-bot` | Whether to comment PR with build link | No | `true` |