mirror of
https://github.com/immich-app/immich.git
synced 2025-01-23 12:12:45 +01:00
fix(CI): fix mobile build artifact with proper signing (#1504)
This commit is contained in:
parent
2c356ec87f
commit
4f38851880
3 changed files with 30 additions and 31 deletions
33
.github/workflows/build-mobile.yml
vendored
33
.github/workflows/build-mobile.yml
vendored
|
@ -7,50 +7,47 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-sign-android:
|
build-sign-android:
|
||||||
name: Build and sign Android
|
name: Build and sign Android
|
||||||
runs-on: ubuntu-latest
|
runs-on: macos-12
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: "zulu"
|
||||||
java-version: "12.x"
|
java-version: "12.x"
|
||||||
cache: 'gradle'
|
cache: "gradle"
|
||||||
|
|
||||||
- name: Setup Flutter SDK
|
- name: Setup Flutter SDK
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
flutter-version: '3.3.10'
|
flutter-version: "3.3.10"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Create the Keystore
|
- name: Create the Keystore
|
||||||
|
|
||||||
env:
|
env:
|
||||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGN_KEY_CONTENT }}
|
KEY_JKS: ${{ secrets.KEY_JKS }}
|
||||||
run: |
|
working-directory: ./mobile
|
||||||
# import keystore from secrets
|
run: echo $KEY_JKS | base64 -d > android/key.jks
|
||||||
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
|
|
||||||
|
|
||||||
- name: Restore packages
|
- name: Get Packages
|
||||||
working-directory: ./mobile
|
working-directory: ./mobile
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Build Android App Bundle
|
- name: Build Android App Bundle
|
||||||
working-directory: ./mobile
|
working-directory: ./mobile
|
||||||
|
env:
|
||||||
|
ALIAS: ${{ secrets.ALIAS }}
|
||||||
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||||
|
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
||||||
run: flutter build apk --release
|
run: flutter build apk --release
|
||||||
|
|
||||||
- name: Sign Android App Bundle
|
|
||||||
working-directory: ./mobile
|
|
||||||
run: jarsigner -keystore $RUNNER_TEMP/my_production.keystore -storepass ${{ secrets.ANDROID_KEY_PASSWORD }} -keypass ${{ secrets.ANDROID_STORE_PASSWORD }} -sigalg SHA256withRSA -digestalg SHA-256 -signedjar build/app/outputs/apk/release/app-release-signed.apk build/app/outputs/apk/release/*.apk ${{ secrets.ALIAS }}
|
|
||||||
|
|
||||||
- name: Publish Android Artifact
|
- name: Publish Android Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release-apk-signed
|
name: release-apk-signed
|
||||||
path: mobile/build/app/outputs/apk/release/app-release-signed.apk
|
path: mobile/build/app/outputs/flutter-apk/app-release.apk
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,4 +8,5 @@ uploads
|
||||||
coverage
|
coverage
|
||||||
|
|
||||||
mobile/gradle.properties
|
mobile/gradle.properties
|
||||||
mobile/openapi/pubspec.lock
|
mobile/openapi/pubspec.lock
|
||||||
|
mobile/*.jks
|
||||||
|
|
|
@ -57,21 +57,22 @@ android {
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
||||||
// signingConfigs {
|
signingConfigs {
|
||||||
// release {
|
release {
|
||||||
// keyAlias keystoreProperties['keyAlias']
|
def keyAliasVal = System.getenv("ALIAS")
|
||||||
// keyPassword keystoreProperties['keyPassword']
|
def keyPasswordVal = System.getenv("ANDROID_KEY_PASSWORD")
|
||||||
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
def storePasswordVal = System.getenv("ANDROID_STORE_PASSWORD")
|
||||||
// storePassword keystoreProperties['storePassword']
|
|
||||||
// }
|
keyAlias keyAliasVal ? keyAliasVal : keystoreProperties['keyAlias']
|
||||||
// }
|
keyPassword keyPasswordVal ? keyPasswordVal : keystoreProperties['keyPassword']
|
||||||
|
storeFile file("../key.jks") ? file("../key.jks") : file(keystoreProperties['storeFile'])
|
||||||
|
storePassword storePasswordVal ? storePasswordVal : keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
// signingConfig signingConfigs.release
|
|
||||||
signingConfig null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue