diff --git a/.gitignore b/.gitignore index 4511167f..9d45b5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,6 @@ lib/generated_plugin_registrant.dart /android/key.properties **/android/app/.cxx android/key.jks +android/keys.json +android/Gemfile.lock lib/l10n_old \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93c25fb1..f8d1b4a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,15 +62,12 @@ build_android_debug: - build/app/outputs/apk/debug/app-debug.apk except: - main + - tags build_android_apk: stage: coverage before_script: [./scripts/prepare-android-release.sh] script: [./scripts/build-android-apk.sh] - variables: - FDROID_KEY: ${FDROID_KEY} - FDROID_KEY_PASS: ${FDROID_KEY_PASS} - GOOGLE_SERVICES: ${GOOGLE_SERVICES} artifacts: when: on_success paths: @@ -82,36 +79,21 @@ build_android_apk: build_android_appbundle: stage: coverage before_script: [./scripts/prepare-android-release.sh] - script: [./scripts/build-android-appbundle.sh] - variables: - FDROID_KEY: ${FDROID_KEY} - FDROID_KEY_PASS: ${FDROID_KEY_PASS} - GOOGLE_SERVICES: ${GOOGLE_SERVICES} + script: [./scripts/release-playstore-beta.sh] artifacts: when: on_success paths: - build/android/app-release.aab + resource_group: playstore_release only: - main upload_to_fdroid_repo: stage: release before_script: - ## - ## Install ssh-agent if not already installed. - ## - 'which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )' - ## - ## Install rsync if not already installed. - ## - 'which rsync || (sudo apt-get update -y && sudo apt-get install rsync -y )' - ## - ## Install pcregrep if not already installed. - ## - 'which pcregrep || (sudo apt-get update -y && sudo apt-get install pcregrep -y )' - ## - ## Run ssh-agent (inside the build environment) - ## - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh @@ -123,8 +105,10 @@ upload_to_fdroid_repo: - rsync -rav -e ssh ./ fluffy@fdroid.nordgedanken.dev:/fdroid/repo - ssh fluffy@fdroid.nordgedanken.dev "cd fdroid && fdroid update" needs: ["build_android_apk"] + resource_group: playstore_release + allow_failure: true only: - - tags + - main pages: stage: deploy @@ -239,6 +223,12 @@ upload-windows: - | curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-windows.tar.gz +upload-playstore: + extends: .release + stage: deploy + script: [./scripts/release-playstore.sh] + resource_group: playstore_release + release: extends: .release image: registry.gitlab.com/gitlab-org/release-cli:latest diff --git a/android/Gemfile b/android/Gemfile new file mode 100644 index 00000000..7a118b49 --- /dev/null +++ b/android/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/android/fastlane/Appfile b/android/fastlane/Appfile new file mode 100644 index 00000000..872e0785 --- /dev/null +++ b/android/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("keys.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one +package_name("chat.fluffy.fluffychat") # e.g. com.krausefx.app diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile new file mode 100644 index 00000000..6521ae8d --- /dev/null +++ b/android/fastlane/Fastfile @@ -0,0 +1,50 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +update_fastlane + +default_platform(:android) + +platform :android do + lane :set_build_code_internal do + versions = google_play_track_version_codes( + track: "internal", + json_key: "./keys.json" + ) + last_version = versions[0].to_i + Dir.chdir("../..") do + re = /version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]/i + config = File.read("./pubspec.yaml") + version_name = config.match(re).captures + + subst = "version: #{version_name[0]}+#{last_version+1}" + + result = config.gsub(re, subst) + + File.open("./pubspec.yaml", 'w') { |file| file.write(result) } + end + end + + lane :deploy_internal_test do + versions = google_play_track_version_codes( + track: "internal", + json_key: "./keys.json" + ) + last_version = versions[0].to_i + upload_to_play_store(track: 'internal', aab: '../build/app/outputs/bundle/release/app-release.aab', version_code: "#{last_version+1}") + end + + lane :deploy_release do + upload_to_play_store(track: 'internal', track_promote_to: "production", deactivate_on_promote: false, skip_upload_changelogs: true) + end +end \ No newline at end of file diff --git a/android/fastlane/README.md b/android/fastlane/README.md new file mode 100644 index 00000000..5a466743 --- /dev/null +++ b/android/fastlane/README.md @@ -0,0 +1,39 @@ +fastlane documentation +================ +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +``` +xcode-select --install +``` + +Install _fastlane_ using +``` +[sudo] gem install fastlane -NV +``` +or alternatively using `brew install fastlane` + +# Available Actions +## Android +### android set_build_code_beta +``` +fastlane android set_build_code_beta +``` + +### android deploy_beta_test +``` +fastlane android deploy_beta_test +``` + +### android deploy_release +``` +fastlane android deploy_release +``` + + +---- + +This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. +More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). +The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/android/fastlane/metadata/android/en-US/changelogs/50 (0.22.1).txt b/android/fastlane/metadata/android/en-US/changelogs/50 (0.22.1).txt new file mode 100644 index 00000000..10f77f4f --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/50 (0.22.1).txt @@ -0,0 +1 @@ +Check out https://gitlab.com/ChristianPauly/fluffychat-flutter/-/blob/main/CHANGELOG.md for the changelog. \ No newline at end of file diff --git a/android/fastlane/metadata/android/en-US/full_description.txt b/android/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 00000000..2118515f --- /dev/null +++ b/android/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1,32 @@ +FluffyChat is an open, nonprofit and cute matrix messenger app for Ubuntu Touch, Android and iOS. + +Open +Opensource and open development where everyone can join. + +Nonprofit +FluffyChat is donation funded. + +Cute ♥ +Cute design and many theme settings including a dark mode. + +One-to-one and groupchats +Unlimited groups and direct chats. + +Easy +FluffyChat is made as simple to use as possible. + +Free +Free to use for everyone without ads. + +Decentralized +There is no "FluffyChat server" you are forced to use. Use the server you find trustworthy or host your own. + +Compatible +Compatible with Riot, Fractal, Nekho and all matrix messengers. + + +FluffyChat comes with a dream + +Imagine a world where everyone can choose the messenger they like and is still able to chat with all of their friends. +A world where there are no companies spying on you when you send selfies to friends and lovers. +And a world where apps are made for fluffyness and not for profit. ♥ \ No newline at end of file diff --git a/android/fastlane/metadata/android/en-US/images/featureGraphic.png b/android/fastlane/metadata/android/en-US/images/featureGraphic.png new file mode 100644 index 00000000..bafa7433 Binary files /dev/null and b/android/fastlane/metadata/android/en-US/images/featureGraphic.png differ diff --git a/android/fastlane/metadata/android/en-US/images/icon.png b/android/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 00000000..3c730b97 Binary files /dev/null and b/android/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/android/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png new file mode 100644 index 00000000..984f60df Binary files /dev/null and b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png differ diff --git a/android/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png new file mode 100644 index 00000000..cd839c96 Binary files /dev/null and b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png differ diff --git a/android/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png new file mode 100644 index 00000000..dc2e041d Binary files /dev/null and b/android/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png differ diff --git a/android/fastlane/metadata/android/en-US/short_description.txt b/android/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 00000000..6d45532e --- /dev/null +++ b/android/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +Chat with your friends with FluffyChat. \ No newline at end of file diff --git a/android/fastlane/metadata/android/en-US/title.txt b/android/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 00000000..df1e0546 --- /dev/null +++ b/android/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +FluffyChat \ No newline at end of file diff --git a/android/fastlane/metadata/android/en-US/video.txt b/android/fastlane/metadata/android/en-US/video.txt new file mode 100644 index 00000000..e69de29b diff --git a/android/fastlane/report.xml b/android/fastlane/report.xml new file mode 100644 index 00000000..f55cba0e --- /dev/null +++ b/android/fastlane/report.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pubspec.yaml b/pubspec.yaml index 8eb4b7aa..7292f15e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: fluffychat description: Chat with your friends. publish_to: none -version: 0.22.1+50 +version: 0.22.1+0 environment: sdk: ">=2.6.0 <3.0.0" diff --git a/scripts/prepare-android-release.sh b/scripts/prepare-android-release.sh index 61680918..6c6f4781 100755 --- a/scripts/prepare-android-release.sh +++ b/scripts/prepare-android-release.sh @@ -1,7 +1,14 @@ #!/usr/bin/env bash -cd android && echo $FDROID_KEY | base64 --decode --ignore-garbage > key.jks && cd .. -cd android && echo "storePassword=${FDROID_KEY_PASS}" >> key.properties && cd .. -cd android && echo "keyPassword=${FDROID_KEY_PASS}" >> key.properties && cd .. -cd android && echo "keyAlias=key" >> key.properties && cd .. -cd android && echo "storeFile=../key.jks" >> key.properties && cd .. -cd android/app && echo $GOOGLE_SERVICES >> google-services.json && cd ../.. +cd android +echo $FDROID_KEY | base64 --decode --ignore-garbage > key.jks +echo "storePassword=${FDROID_KEY_PASS}" >> key.properties +echo "keyPassword=${FDROID_KEY_PASS}" >> key.properties +echo "keyAlias=key" >> key.properties +echo "storeFile=../key.jks" >> key.properties +echo $PLAYSTORE_DEPLOY_KEY >> keys.json +bundle install +bundle update fastlane +bundle exec fastlane set_build_code_internal +cd app +echo $GOOGLE_SERVICES >> google-services.json/.. +cd ../.. \ No newline at end of file diff --git a/scripts/build-android-appbundle.sh b/scripts/release-playstore-beta.sh similarity index 80% rename from scripts/build-android-appbundle.sh rename to scripts/release-playstore-beta.sh index 43512b85..c728a9e3 100755 --- a/scripts/build-android-appbundle.sh +++ b/scripts/release-playstore-beta.sh @@ -5,3 +5,6 @@ flutter pub get flutter build appbundle --target-platform android-arm,android-arm64,android-x64 mkdir -p build/android cp build/app/outputs/bundle/release/app-release.aab build/android/ +cd android +bundle exec fastlane deploy_internal_test +cd .. \ No newline at end of file diff --git a/scripts/release-playstore.sh b/scripts/release-playstore.sh new file mode 100755 index 00000000..8d5633ce --- /dev/null +++ b/scripts/release-playstore.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +cd android +bundle install +bundle update fastlane +echo $PLAYSTORE_DEPLOY_KEY >> keys.json +bundle exec fastlane deploy_release +cd .. \ No newline at end of file