Fix PR workflow for fork

This commit is contained in:
Cuong-Tran 2025-03-09 17:16:55 +07:00
parent 60cf45662b
commit 1ae2c0572c
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -50,14 +50,14 @@ jobs:
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3 uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with: with:
path: app/google-services.json path: app/google-services.json
contents: ${{ secrets.GOOGLE_SERVICES_JSON }} contents: "${{ secrets.GOOGLE_SERVICES_JSON }}"
write-mode: overwrite write-mode: overwrite
- name: Write client_secrets.json - name: Write client_secrets.json
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3 uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with: with:
path: app/src/main/assets/client_secrets.json path: app/src/main/assets/client_secrets.json
contents: ${{ secrets.GOOGLE_CLIENT_SECRETS_JSON }} contents: "${{ secrets.GOOGLE_CLIENT_SECRETS_JSON }}"
write-mode: overwrite write-mode: overwrite
- name: Set up gradle - name: Set up gradle
@ -73,6 +73,7 @@ jobs:
run: ./gradlew testReleaseUnitTest run: ./gradlew testReleaseUnitTest
- name: Sign APK - name: Sign APK
if: github.repository == github.event.pull_request.head.repo.full_name
uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478 uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478
with: with:
releaseDirectory: app/build/outputs/apk/release releaseDirectory: app/build/outputs/apk/release
@ -83,6 +84,13 @@ jobs:
env: env:
BUILD_TOOLS_VERSION: '35.0.1' BUILD_TOOLS_VERSION: '35.0.1'
- name: Signed File name
id: signed_filename
if: github.repository == github.event.pull_request.head.repo.full_name
run: |
set -x
echo "SIGNED_TRAIL=-signed" >> $GITHUB_OUTPUT
- name: Rename apk - name: Rename apk
id: current_commit id: current_commit
run: | run: |
@ -94,7 +102,7 @@ jobs:
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
echo "COMMIT_COUNT=$commit_count" echo "COMMIT_COUNT=$commit_count"
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
mv app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk Komikku-$version_tag-r$commit_count.apk mv app/build/outputs/apk/release/app-universal-release-unsigned${{ steps.signed_filename.outputs.SIGNED_TRAIL }}.apk Komikku-$version_tag-r$commit_count.apk
- name: Upload APK - name: Upload APK
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1