Skip to content

Commit

Permalink
github: let flutter handle signing
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Sep 14, 2024
1 parent 9e40ec3 commit 9ddf34c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 56 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/android-play-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ jobs:
restore-keys: |
${{ runner.OS }}-saber-
- name: Remove signingConfig
run: ./patches/remove_signing_android.sh

- name: Remove REQUEST_INSTALL_PACKAGES permission
run: ./patches/remove_request_install_packages_permission.sh

- name: Remove simulator dependency
run: ./patches/remove_simulator_dependency.sh

- name: Setup keystore
run: |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d > android/android.keystore
echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ALIAS }}" >> android/key.properties
echo "storeFile=../android.keystore" >> android/key.properties
- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand Down Expand Up @@ -64,24 +69,11 @@ jobs:
--dart-define=UPDATE_CHECK="false" \
--dart-define=DIRTY="false"
- name: Move unsigned apk
- name: Rename aab
run: |
mkdir -p output
mv build/app/outputs/bundle/release/app-release.aab output/Saber.aab
- name: Sign aab
uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: output
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Rename signed apk
run: mv ${{ steps.sign_app.outputs.signedFile }} output/Saber.aab

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
58 changes: 24 additions & 34 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
- name: Remove simulator dependency
run: ./patches/remove_simulator_dependency.sh

- name: Setup keystore
run: |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d > android/android.keystore
echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ALIAS }}" >> android/key.properties
echo "storeFile=../android.keystore" >> android/key.properties
- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand All @@ -59,29 +67,16 @@ jobs:
env:
DIRTY: ${{ !startsWith(github.ref, 'refs/tags/') }}

- name: Move unsigned apk
run: |
mkdir -p output
mv build/app/outputs/flutter-apk/app-release.apk output/
- name: Sign apk
uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: output
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Rename signed apk
- name: Rename apk
id: rename_apk
run: |
buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
apkName="Saber_v${buildName}.apk"
mv ${{ steps.sign_app.outputs.signedFile }} output/$apkName
echo "apkName=$apkName" >> $GITHUB_OUTPUT
mkdir -p output
mv build/app/outputs/flutter-apk/app-release.apk output/$apkName
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -119,6 +114,14 @@ jobs:

- name: Remove simulator dependency
run: ./patches/remove_simulator_dependency.sh

- name: Setup keystore
run: |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d > android/android.keystore
echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ALIAS }}" >> android/key.properties
echo "storeFile=../android.keystore" >> android/key.properties
- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand All @@ -145,29 +148,16 @@ jobs:
env:
DIRTY: ${{ !startsWith(github.ref, 'refs/tags/') }}

- name: Move unsigned apk
run: |
mkdir -p output
mv build/app/outputs/flutter-apk/app-release.apk output/
- name: Sign apk
uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: output
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Rename signed apk
- name: Rename apk
id: rename_apk
run: |
buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
apkName="Saber_FOSS_v${buildName}.apk"
mv ${{ steps.sign_app.outputs.signedFile }} output/$apkName
echo "apkName=$apkName" >> $GITHUB_OUTPUT
mkdir -p output
mv build/app/outputs/flutter-apk/app-release.apk output/$apkName
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 0 additions & 5 deletions patches/remove_signing_android.sh

This file was deleted.

0 comments on commit 9ddf34c

Please sign in to comment.