Skip to content

Commit

Permalink
add key signing and apk creation to workflow, update package paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Lab-Brat committed Aug 26, 2023
1 parent 9c2240d commit 8e1e5ec
Showing 1 changed file with 51 additions and 11 deletions.
62 changes: 51 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build 🤖 📦 and release apk and aab
name: 🤖 📦 Build and release packages for Android
on: push

jobs:
build-n-publish:
name: Build 🤖 📦
build-n-release:
name: 🤖 📦 Build and release
runs-on: ubuntu-latest

steps:
Expand All @@ -16,20 +16,60 @@ jobs:
with:
flutter-version: '3.10.6'

- name: Update Flutter dependency list
- name: 🔑 Create Google Services JSON File
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo $GOOGLE_SERVICES_JSON | base64 -di > ./android/app/google-services.json
- name: 🔑 Create the Keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE }}
run: |
echo $KEYSTORE_BASE64 | base64 -di > $RUNNER_TEMP/upload.keystore
- name: 🪺 Update Flutter dependency list
run: flutter pub get

- name: Build apk
- name: ⚙️ Build apk
run: flutter build apk

- name: Build bundle (aab)
- name: ✒️ Sign Android APK
if: startsWith(github.ref, 'refs/tags')
run: |
jarsigner -keystore $RUNNER_TEMP/upload.keystore \
-storepass ${{ secrets.KEYSTORE_PASS }} \
-keypass ${{ secrets.KEYSTORE_PASS }} \
-sigalg SHA256withRSA \
-digestalg SHA-256 \
-signedjar build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/*.apk \
upload
- name: ⚙️ Build bundle (aab)
if: startsWith(github.ref, 'refs/tags')
run: flutter build appbundle

- name: Publish 📦 to PyPI if it's tagged
- name: ✒️ Sign Android App Bundle
if: startsWith(github.ref, 'refs/tags')
run: |
jarsigner -keystore $RUNNER_TEMP/upload.keystore \
-storepass ${{ secrets.KEYSTORE_PASS }} \
-keypass ${{ secrets.KEYSTORE_PASS }} \
-sigalg SHA256withRSA \
-digestalg SHA-256 \
-signedjar build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/*.aab \
upload
- name: 📦 Save APK as artifact
if: startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v1
with:
name: "gentoo_update-${{ github.ref_name }}.apk"
path: build/app/outputs/apk/release/app-release.apk

- name: 📦 Save Bundle as artifact
if: startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v1
with:
name: release-apk
path: |
build/app/outputs/apk/release/app-release.apk
build/app/outputs/bundle/release/app-release.aab
name: "gentoo_update-${{ github.ref_name }}.aab"
path: build/app/outputs/bundle/release/app-release.aab

0 comments on commit 8e1e5ec

Please sign in to comment.