Skip to content

Commit f512e32

Browse files
committed
Refactor: update Android workflow
This commit updates the Android workflow in `.github/workflows/android.yml` with several changes: - Moved `GOOGLE_PLAY_JSON_PATH` environment variable declaration to the top level. - Simplified the `Create Google Service Account JSON` step by removing the unnecessary `mkdir -p app` command. - Removed `persist-credentials: false` from the checkout action in the `release` job as it's the default behavior. - Removed the separate `Cache Ruby Gems` step in the `release` job as it's now handled by `bundler-cache: true` in `setup-ruby`. - Added a `Debug Secrets` step to the `release` job for easier troubleshooting. - Renamed "Grant execute permission for gradlew" to "Grant gradlew permission" for brevity in the `release` job. - Added `bundle update fastlane` to the `test` job to ensure the latest version of Fastlane is used. - Added "Grant gradlew permission" step to the `test`, `lint`, `coverage`, and `licenses` jobs. - Removed `fetch-depth: 1` from checkout actions in `test`, `lint`, `coverage`, and `licenses` jobs as it's not strictly necessary for these tasks.
1 parent 9f2f530 commit f512e32

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/android.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010

1111
env:
1212
KEYSTORE_FILE: keystore-qrbarcode.jks
13+
GOOGLE_PLAY_JSON_PATH: app/qrbarcode-8b0b8-aaefa03b2374.json
1314
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
1415
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
1516
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
16-
GOOGLE_PLAY_JSON_PATH: app/qrbarcode-8b0b8-aaefa03b2374.json
1717

1818
jobs:
1919
setup:
@@ -57,9 +57,7 @@ jobs:
5757
run: echo "${{ secrets.KEYSTORE_FILE }}" | base64 -d > ${{ env.KEYSTORE_FILE }}
5858

5959
- name: Create Google Service Account JSON
60-
run: |
61-
mkdir -p app
62-
echo "${{ secrets.GOOGLE_PLAY_JSON }}" | base64 -d > ${{ env.GOOGLE_PLAY_JSON_PATH }}
60+
run: echo "${{ secrets.GOOGLE_PLAY_JSON }}" | base64 -d > ${{ env.GOOGLE_PLAY_JSON_PATH }}
6361

6462
- name: Upload Secrets
6563
uses: actions/upload-artifact@v4
@@ -78,7 +76,6 @@ jobs:
7876
- uses: actions/checkout@v3
7977
with:
8078
fetch-depth: 1
81-
persist-credentials: false
8279

8380
- name: Setup JDK 17
8481
uses: actions/setup-java@v3
@@ -92,8 +89,7 @@ jobs:
9289
ruby-version: '3.1'
9390
bundler-cache: true
9491

95-
- name: Cache Ruby Gems
96-
uses: actions/cache@v4
92+
- uses: actions/cache@v4
9793
with:
9894
path: vendor/bundle
9995
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
@@ -108,6 +104,9 @@ jobs:
108104
with:
109105
name: secrets
110106

107+
- name: Debug Secrets
108+
run: ls -la .
109+
111110
- name: Write local.properties
112111
run: |
113112
echo "sdk.dir=$ANDROID_HOME" > local.properties
@@ -116,7 +115,7 @@ jobs:
116115
echo "KEY_ALIAS=${{ env.KEY_ALIAS }}" >> local.properties
117116
echo "KEY_PASSWORD=${{ env.KEY_PASSWORD }}" >> local.properties
118117
119-
- name: Grant execute permission for gradlew
118+
- name: Grant gradlew permission
120119
run: chmod +x ./gradlew
121120

122121
- name: Build AAB via Fastlane
@@ -150,6 +149,10 @@ jobs:
150149
- run: |
151150
bundle config set path 'vendor/bundle'
152151
bundle install
152+
bundle update fastlane
153+
154+
- name: Grant gradlew permission
155+
run: chmod +x ./gradlew
153156

154157
- run: bundle exec fastlane test
155158

@@ -168,6 +171,9 @@ jobs:
168171
java-version: '17'
169172
distribution: 'temurin'
170173

174+
- name: Grant gradlew permission
175+
run: chmod +x ./gradlew
176+
171177
- run: ./gradlew clean check
172178

173179
- uses: actions/upload-artifact@v4
@@ -186,8 +192,6 @@ jobs:
186192

187193
steps:
188194
- uses: actions/checkout@v3
189-
with:
190-
fetch-depth: 1
191195

192196
- uses: ruby/setup-ruby@v1
193197
with:
@@ -213,8 +217,6 @@ jobs:
213217

214218
steps:
215219
- uses: actions/checkout@v3
216-
with:
217-
fetch-depth: 1
218220

219221
- uses: ruby/setup-ruby@v1
220222
with:
@@ -240,8 +242,6 @@ jobs:
240242

241243
steps:
242244
- uses: actions/checkout@v3
243-
with:
244-
fetch-depth: 1
245245

246246
- uses: ruby/setup-ruby@v1
247247
with:

0 commit comments

Comments
 (0)