mirror of
https://github.com/immich-app/immich.git
synced 2026-07-06 04:34:45 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06eae08d44 | |||
| 92293eba19 | |||
| e93f0db224 | |||
| 46d8be8ffc | |||
| df051c24b3 |
@@ -73,6 +73,7 @@ jobs:
|
|||||||
needs: pre-job
|
needs: pre-job
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
deployments: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
if: ${{ github.actor != 'dependabot[bot]' && fromJSON(needs.pre-job.outputs.should_run).mobile == true }}
|
if: ${{ github.actor != 'dependabot[bot]' && fromJSON(needs.pre-job.outputs.should_run).mobile == true }}
|
||||||
runs-on: mich
|
runs-on: mich
|
||||||
@@ -142,9 +143,18 @@ jobs:
|
|||||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||||
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
||||||
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
|
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
IS_MAIN_DEPLOYMENT: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
|
IS_DEPLOYMENT_BUILD: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) }}
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ $IS_DEPLOYMENT_BUILD == 'true' ]]; then
|
||||||
|
export ANDROID_APP_LABEL='Immich Staging'
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $IS_MAIN == 'true' ]]; then
|
if [[ $IS_MAIN == 'true' ]]; then
|
||||||
|
if [[ $IS_MAIN_DEPLOYMENT == 'true' ]]; then
|
||||||
|
export ANDROID_APPLICATION_ID=app.immich.main
|
||||||
|
fi
|
||||||
flutter build apk --release
|
flutter build apk --release
|
||||||
flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64
|
flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64
|
||||||
else
|
else
|
||||||
@@ -158,6 +168,50 @@ jobs:
|
|||||||
name: release-apk-signed
|
name: release-apk-signed
|
||||||
path: mobile/build/app/outputs/flutter-apk/*.apk
|
path: mobile/build/app/outputs/flutter-apk/*.apk
|
||||||
|
|
||||||
|
- name: Publish Android APK deployment
|
||||||
|
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) }}
|
||||||
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||||
|
env:
|
||||||
|
APK_URL: ${{ steps.upload-apk.outputs.artifact-url }}
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const artifactUrl = process.env.APK_URL;
|
||||||
|
const isPullRequest = context.eventName === "pull_request";
|
||||||
|
const pullNumber = context.payload.pull_request?.number;
|
||||||
|
const environment = isPullRequest ? `mobile-android-apk-pr-${pullNumber}` : "mobile-android-apk";
|
||||||
|
const description = isPullRequest
|
||||||
|
? `Signed Android APK for PR #${pullNumber}`
|
||||||
|
: "Latest signed Android APK from main";
|
||||||
|
const ref = isPullRequest ? context.payload.pull_request.head.sha : context.sha;
|
||||||
|
|
||||||
|
if (!artifactUrl) {
|
||||||
|
throw new Error("The Android APK artifact URL was not generated");
|
||||||
|
}
|
||||||
|
|
||||||
|
const runUrl = `${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
|
||||||
|
const deployment = await github.rest.repos.createDeployment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref,
|
||||||
|
environment,
|
||||||
|
description,
|
||||||
|
auto_merge: false,
|
||||||
|
required_contexts: [],
|
||||||
|
production_environment: false,
|
||||||
|
transient_environment: isPullRequest,
|
||||||
|
});
|
||||||
|
|
||||||
|
await github.rest.repos.createDeploymentStatus({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
deployment_id: deployment.data.id,
|
||||||
|
state: "success",
|
||||||
|
environment,
|
||||||
|
environment_url: artifactUrl,
|
||||||
|
log_url: runUrl,
|
||||||
|
description: "Signed APK artifact is ready for testing",
|
||||||
|
});
|
||||||
|
|
||||||
- name: Comment APK download link on PR
|
- name: Comment APK download link on PR
|
||||||
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }}
|
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }}
|
||||||
uses: immich-app/devtools/actions/sticky-comment@0135acd12ad9f3369b94a2aa3c0ae8c835a4e926 # sticky-comment-action-v1.0.0
|
uses: immich-app/devtools/actions/sticky-comment@0135acd12ad9f3369b94a2aa3c0ae8c835a4e926 # sticky-comment-action-v1.0.0
|
||||||
|
|||||||
@@ -13,6 +13,16 @@ if (keystorePropertiesFile.exists()) {
|
|||||||
keystorePropertiesFile.withInputStream { keystoreProperties.load(it) }
|
keystorePropertiesFile.withInputStream { keystoreProperties.load(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def androidApplicationId = System.getenv("ANDROID_APPLICATION_ID")?.trim()
|
||||||
|
if (!androidApplicationId) {
|
||||||
|
androidApplicationId = "app.alextran.immich"
|
||||||
|
}
|
||||||
|
|
||||||
|
def androidAppLabel = System.getenv("ANDROID_APP_LABEL")?.trim()
|
||||||
|
if (!androidAppLabel) {
|
||||||
|
androidAppLabel = "Immich"
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
@@ -37,11 +47,12 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "app.alextran.immich"
|
applicationId androidApplicationId
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode flutter.versionCode
|
versionCode flutter.versionCode
|
||||||
versionName flutter.versionName
|
versionName flutter.versionName
|
||||||
|
manifestPlaceholders = [appLabel: androidAppLabel]
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
|
||||||
|
|
||||||
<application android:label="Immich" android:name=".ImmichApp" android:usesCleartextTraffic="true"
|
<application android:label="${appLabel}" android:name=".ImmichApp" android:usesCleartextTraffic="true"
|
||||||
android:icon="@mipmap/ic_launcher" android:requestLegacyExternalStorage="true"
|
android:icon="@mipmap/ic_launcher" android:requestLegacyExternalStorage="true"
|
||||||
android:largeHeap="true" android:enableOnBackInvokedCallback="false" android:allowBackup="false"
|
android:largeHeap="true" android:enableOnBackInvokedCallback="false" android:allowBackup="false"
|
||||||
android:networkSecurityConfig="@xml/network_security_config">
|
android:networkSecurityConfig="@xml/network_security_config">
|
||||||
|
|||||||
Reference in New Issue
Block a user