@@ -37,6 +37,9 @@ inputs:
3737 keystore-base64 :
3838 description : ' Base64 version of the release keystore'
3939 required : false
40+ keystore-file :
41+ description : ' Path to the keystore file'
42+ required : false
4043 keystore-store-file :
4144 description : ' Keystore store file name'
4245 required : false
6871 - name : Validate Inputs
6972 run : |
7073 if [ "${{ inputs.sign }}" == "true" ]; then
71- if [ -z "${{ inputs.keystore-base64 }}" ]; then
72- echo "Input 'keystore-base64' is required for signed builds."
74+ if [ -z "${{ inputs.keystore-file }}" ] && [ -z "${{ inputs.keystore-base64 }}" ]; then
75+ echo "Either 'keystore-file' or 'keystore-base64' is required for signed builds."
76+ exit 1
77+ fi
78+
79+ # Validate keystore file actually exists if provided
80+ if [ -n "${{ inputs.keystore-file }}" ] && [ ! -f "${{ inputs.keystore-file }}" ]; then
81+ echo "Keystore file '${{ inputs.keystore-file }}' does not exist."
7382 exit 1
7483 fi
7584
@@ -116,7 +125,6 @@ runs:
116125 mkdir -p .rock/cache
117126 echo "{\"githubToken\": \"${{ inputs.github-token }}\"}" > .rock/cache/project.json
118127 shell : bash
119-
120128 # We create PR-related artifacts to avoid overwriting the main artifact with new JS bundle
121129 - name : Check if PR-related artifact exists
122130 if : ${{ github.event_name == 'pull_request' && inputs.re-sign == 'true' }}
@@ -131,7 +139,7 @@ runs:
131139 echo "ARTIFACT_NAME=$(echo "$OUTPUT" | jq -r '.name')" >> $GITHUB_ENV
132140 fi
133141 shell : bash
134-
142+
135143 - name : Check if regular artifact exists
136144 if : ${{ !env.ARTIFACT_NAME }}
137145 run : |
@@ -145,7 +153,6 @@ runs:
145153 echo "ARTIFACT_NAME=$(echo "$OUTPUT" | jq -r '.name')" >> $GITHUB_ENV
146154 fi
147155 shell : bash
148-
149156 - name : Set Artifact Name (if not set)
150157 if : ${{ !env.ARTIFACT_NAME }}
151158 run : |
@@ -193,8 +200,13 @@ runs:
193200 - name : Decode and store keystore file
194201 if : ${{ !env.ARTIFACT_URL && inputs.sign }}
195202 run : |
196- echo "${{ inputs.keystore-base64 }}" | base64 --decode > $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore
203+ if [ -n "${{ inputs.keystore-file }}" ]; then
204+ cp "${{ inputs.keystore-file }}" $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore
205+ else
206+ echo "${{ inputs.keystore-base64 }}" | base64 --decode > $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore
207+ fi
197208 shell : bash
209+ working-directory : ${{ inputs.working-directory }}
198210
199211 - name : Build Android
200212 if : ${{ !env.ARTIFACT_URL }}
@@ -212,7 +224,7 @@ runs:
212224 echo APK_PATH $APK_PATH
213225 echo "ARTIFACT_PATH=$APK_PATH" >> $GITHUB_ENV
214226 shell : bash
215-
227+
216228 - name : Download and Unpack APK
217229 if : ${{ env.ARTIFACT_URL && inputs.re-sign == 'true' && github.event_name == 'pull_request' }}
218230 run : |
@@ -240,7 +252,6 @@ runs:
240252 echo "ARTIFACT_ID=$(echo "$OUTPUT" | jq -r '.id')" >> $GITHUB_ENV
241253 fi
242254 shell : bash
243-
244255 # Special case for GitHub, as it doesn't support uploading through the API
245256 - name : Upload Artifact to GitHub
246257 id : upload-artifact
@@ -279,6 +290,7 @@ runs:
279290 rm $HOME/.gradle/gradle.properties
280291 rm $ANDROID_SOURCE_DIR/$APP_NAME/release.keystore
281292 shell : bash
293+ working-directory : ${{ inputs.working-directory }}
282294
283295 - name : Post Build
284296 if : ${{ github.event_name == 'pull_request' && inputs.comment-bot == 'true' }}
0 commit comments