diff --git a/README.md b/README.md index 202bcbc..d12b54e 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: for custom keystore locations ``` ## 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` | 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` | ## Outputs diff --git a/action.yml b/action.yml index 0049ad0..3f9d1b5 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,15 @@ 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")" || { + echo "Failed to create keystore directory: $(dirname "$KEYSTORE_TARGET_PATH")" + exit 1 + } 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 +312,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 }}