diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..64cb414065 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{ts,js}] +quote_type = single + +[*.{md,mdx}] +max_line_length = off +trim_trailing_whitespace = false + +[*.{yml,yaml}] +quote_type = double diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.yml index bf85137072..071c89e6da 100644 --- a/.github/workflows/build-mobile.yml +++ b/.github/workflows/build-mobile.yml @@ -2,54 +2,52 @@ name: Build Mobile on: workflow_dispatch: + workflow_call: pull_request: push: branches: [main] - jobs: build-sign-android: name: Build and sign Android - runs-on: ubuntu-latest - + runs-on: macos-12 + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: 'zulu' + distribution: "zulu" java-version: "12.x" - cache: 'gradle' + cache: "gradle" - name: Setup Flutter SDK uses: subosito/flutter-action@v2 with: - channel: 'stable' - flutter-version: '3.3.10' + channel: "stable" + flutter-version: "3.3.10" cache: true - name: Create the Keystore - env: - KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGN_KEY_CONTENT }} - run: | - # import keystore from secrets - echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore + KEY_JKS: ${{ secrets.KEY_JKS }} + working-directory: ./mobile + run: echo $KEY_JKS | base64 -d > android/key.jks - - name: Restore packages + - name: Get Packages working-directory: ./mobile run: flutter pub get - name: Build Android App Bundle 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 - - 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 - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: release-apk-signed - path: mobile/build/app/outputs/apk/release/app-release-signed.apk \ No newline at end of file + path: mobile/build/app/outputs/flutter-apk/app-release.apk diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 22bb16ffad..882ed3d480 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,7 +34,7 @@ jobs: uses: docker/setup-qemu-action@v2.1.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.2.1 + uses: docker/setup-buildx-action@v2.4.0 # Workaround to fix error: # failed to push: failed to copy: io: read/write on closed pipe # See https://github.com/docker/build-push-action/issues/761 @@ -89,7 +89,7 @@ jobs: fi - name: Build and push image - uses: docker/build-push-action@v3.3.0 + uses: docker/build-push-action@v4.0.0 with: context: ${{ matrix.context }} platforms: linux/arm/v7,linux/amd64,linux/arm64 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 3cf6fb6cbd..5a7f0aa23b 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -4,23 +4,28 @@ on: workflow_dispatch: inputs: serverBump: - description: 'Bump server version' + description: "Bump server version" required: true - default: 'false' + default: "false" type: choice options: - - false - - minor - - patch + - "false" + - minor + - patch mobileBump: - description: 'Bump mobile build number' + description: "Bump mobile build number" required: false type: boolean jobs: + build_mobile: + uses: ./.github/workflows/build-mobile.yml + secrets: inherit + tag_release: runs-on: ubuntu-latest - + needs: build_mobile + steps: - name: Checkout uses: actions/checkout@v3 @@ -29,7 +34,7 @@ jobs: - name: Bump version run: misc/release/pump-version.sh -s "${{ inputs.serverBump }}" -m "${{ inputs.mobileBump }}" - + - name: Commit and tag uses: EndBug/add-and-commit@v9 with: @@ -38,7 +43,12 @@ jobs: message: "Version ${{ env.IMMICH_VERSION }}" tag: ${{ env.IMMICH_VERSION }} push: true - + + - name: Download APK + uses: actions/download-artifact@v3 + with: + name: release-apk-signed + - name: Create draft release uses: softprops/action-gh-release@v1 with: @@ -49,3 +59,4 @@ jobs: files: | docker/docker-compose.yml docker/example.env + *.apk diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 503bdc724f..6d8907a34a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: name: Run mobile unit tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Flutter SDK uses: subosito/flutter-action@v2 with: @@ -58,7 +58,7 @@ jobs: name: Run mobile end-to-end integration tests runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: distribution: 'adopt' diff --git a/.gitignore b/.gitignore index 32ef7ed927..83e90831d3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ uploads coverage mobile/gradle.properties -mobile/openapi/pubspec.lock \ No newline at end of file +mobile/openapi/pubspec.lock +mobile/*.jks diff --git a/misc/release/pump-version.sh b/misc/release/pump-version.sh index 3faf98c7ae..e22497fd9f 100755 --- a/misc/release/pump-version.sh +++ b/misc/release/pump-version.sh @@ -6,7 +6,7 @@ # usage: './scripts/pump-version.sh -s <-m> # # examples: -# ./scripts/pump-version.sh -s major # 1.0.0+50 => 2.0.0+50 +# ./scripts/pump-version.sh -s major # 1.0.0+50 => 2.0.0+50 # ./scripts/pump-version.sh -s minor -m # 1.0.0+50 => 1.1.0+51 # ./scripts/pump-version.sh -m # 1.0.0+50 => 1.0.0+51 # @@ -16,10 +16,12 @@ MOBILE_PUMP="false" while getopts 's:m:' flag; do case "${flag}" in - s) SERVER_PUMP=${OPTARG} ;; - m) MOBILE_PUMP=${OPTARG} ;; - *) echo "Invalid args" - exit 1 ;; + s) SERVER_PUMP=${OPTARG} ;; + m) MOBILE_PUMP=${OPTARG} ;; + *) + echo "Invalid args" + exit 1 + ;; esac done @@ -30,8 +32,11 @@ PATCH=$(echo $CURRENT_SERVER | cut -d '.' -f3) if [[ $SERVER_PUMP == "major" ]]; then MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 elif [[ $SERVER_PUMP == "minor" ]]; then MINOR=$((MINOR + 1)) + PATCH=0 elif [[ $SERVER_PUMP == "patch" ]]; then PATCH=$((PATCH + 1)) elif [[ $SERVER_PUMP == "false" ]]; then @@ -54,8 +59,6 @@ else exit 1 fi - - if [ "$CURRENT_SERVER" != "$NEXT_SERVER" ]; then echo "Pumping Server: $CURRENT_SERVER => $NEXT_SERVER" @@ -66,8 +69,6 @@ if [ "$CURRENT_SERVER" != "$NEXT_SERVER" ]; then sed -i "s/version_number: \"$CURRENT_SERVER\"$/version_number: \"$NEXT_SERVER\"/" mobile/ios/fastlane/Fastfile fi - - if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; then echo "Pumping Mobile: $CURRENT_MOBILE => $NEXT_MOBILE" @@ -76,4 +77,4 @@ if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; then sed -i "s/^version: $CURRENT_SERVER+$CURRENT_MOBILE$/version: $NEXT_SERVER+$NEXT_MOBILE/" mobile/pubspec.yaml fi -echo "IMMICH_VERSION=v$NEXT_SERVER" >> $GITHUB_ENV +echo "IMMICH_VERSION=v$NEXT_SERVER" >>$GITHUB_ENV diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index da8ed20712..3d3435a2a5 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -57,21 +57,22 @@ android { versionName flutterVersionName } - // signingConfigs { - // release { - // keyAlias keystoreProperties['keyAlias'] - // keyPassword keystoreProperties['keyPassword'] - // storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - // storePassword keystoreProperties['storePassword'] - // } - // } + signingConfigs { + release { + def keyAliasVal = System.getenv("ALIAS") + def keyPasswordVal = System.getenv("ANDROID_KEY_PASSWORD") + def storePasswordVal = System.getenv("ANDROID_STORE_PASSWORD") + + 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 { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - // signingConfig signingConfigs.release - signingConfig null + signingConfig signingConfigs.release } } } diff --git a/mobile/android/app/src/main/res/drawable-hdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-hdpi/android12splash.png deleted file mode 100644 index 50ad4fe6e8..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-hdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-mdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-mdpi/android12splash.png deleted file mode 100644 index 9bffdc36cd..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-mdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-night-hdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-night-hdpi/android12splash.png deleted file mode 100644 index 50ad4fe6e8..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-night-hdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-night-mdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-night-mdpi/android12splash.png deleted file mode 100644 index 9bffdc36cd..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-night-mdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-night-xhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-night-xhdpi/android12splash.png deleted file mode 100644 index 141ed6e87d..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-night-xhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png deleted file mode 100644 index 3f9ee2b4b0..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png deleted file mode 100644 index 5147fd261d..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-v21/background.png b/mobile/android/app/src/main/res/drawable-v21/background.png deleted file mode 100644 index d4e7085f12..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-v21/background.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-v21/launch_background.xml b/mobile/android/app/src/main/res/drawable-v21/launch_background.xml index f88598cf6c..f74085f3f6 100644 --- a/mobile/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/mobile/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,6 +1,12 @@ + - - - + + + + diff --git a/mobile/android/app/src/main/res/drawable-xhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-xhdpi/android12splash.png deleted file mode 100644 index 141ed6e87d..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-xhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-xxhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-xxhdpi/android12splash.png deleted file mode 100644 index 3f9ee2b4b0..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-xxhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable-xxxhdpi/android12splash.png b/mobile/android/app/src/main/res/drawable-xxxhdpi/android12splash.png deleted file mode 100644 index 5147fd261d..0000000000 Binary files a/mobile/android/app/src/main/res/drawable-xxxhdpi/android12splash.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable/background.png b/mobile/android/app/src/main/res/drawable/background.png deleted file mode 100644 index d4e7085f12..0000000000 Binary files a/mobile/android/app/src/main/res/drawable/background.png and /dev/null differ diff --git a/mobile/android/app/src/main/res/drawable/launch_background.xml b/mobile/android/app/src/main/res/drawable/launch_background.xml index f88598cf6c..304732f884 100644 --- a/mobile/android/app/src/main/res/drawable/launch_background.xml +++ b/mobile/android/app/src/main/res/drawable/launch_background.xml @@ -1,6 +1,12 @@ + - - - + + + + diff --git a/mobile/android/app/src/main/res/values-night-v31/styles.xml b/mobile/android/app/src/main/res/values-night-v31/styles.xml deleted file mode 100644 index 8597414ae1..0000000000 --- a/mobile/android/app/src/main/res/values-night-v31/styles.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - diff --git a/mobile/android/app/src/main/res/values-v31/styles.xml b/mobile/android/app/src/main/res/values-v31/styles.xml deleted file mode 100644 index 2c04230b69..0000000000 --- a/mobile/android/app/src/main/res/values-v31/styles.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - diff --git a/mobile/android/app/src/main/res/values/styles.xml b/mobile/android/app/src/main/res/values/styles.xml index 0d15186673..d460d1e921 100644 --- a/mobile/android/app/src/main/res/values/styles.xml +++ b/mobile/android/app/src/main/res/values/styles.xml @@ -5,9 +5,6 @@ @drawable/launch_background - false - false - shortEdges