From 17dc6ed18515a3ed067228ae833f09bc0245cf93 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sun, 5 Dec 2021 09:13:23 +0100 Subject: [PATCH] CI: Add candidate release pipeline --- .gitlab-ci.yml | 2 ++ android/fastlane/Fastfile | 6 +++++- ios/fastlane/Fastfile | 2 +- scripts/publish-snap-stable.sh | 6 +++++- scripts/release-playstore.sh | 6 +++++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 46cd6e96..dadb60f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -221,7 +221,9 @@ update-dependencies: image: curlimages/curl:latest rules: - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' + - if: '$CI_COMMIT_TAG =~ /^rc\d+\.\d+\.\d+$/' before_script: + - export RELEASE_TYPE=$(echo $CI_COMMIT_TAG | grep -oE "[a-z]+") - export RELEASE_VERSION=$(echo $CI_COMMIT_TAG | grep -oE "\d+\.\d+\.\d+") - export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/fluffychat/${RELEASE_VERSION}" diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 85262cf7..a0d48467 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -44,7 +44,11 @@ platform :android do upload_to_play_store(track: 'internal', aab: '../build/app/outputs/bundle/release/app-release.aab', version_code: "#{last_version+1}") end + lane :deploy_candidate do + upload_to_play_store(track: 'internal', track_promote_to: "beta", deactivate_on_promote: false, skip_upload_changelogs: true) + end + lane :deploy_release do - upload_to_play_store(track: 'internal', track_promote_to: "production", deactivate_on_promote: false, skip_upload_changelogs: true) + upload_to_play_store(track: 'beta', track_promote_to: "production", deactivate_on_promote: false, skip_upload_changelogs: true) end end diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 0201c1bc..c2bac8f3 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -27,7 +27,7 @@ platform :ios do version_name = config.match(re).captures[0] increment_version_number(version_number: version_name) build_app(workspace: "Runner.xcworkspace", scheme: "Runner") - upload_to_testflight + upload_to_testflight(distribute_external: true, groups: "FluffyChat Betatest") end end diff --git a/scripts/publish-snap-stable.sh b/scripts/publish-snap-stable.sh index 4bf6ab3f..ecb55478 100755 --- a/scripts/publish-snap-stable.sh +++ b/scripts/publish-snap-stable.sh @@ -1,5 +1,9 @@ #!/bin/sh -ve echo $SNAPCRAFT_LOGIN_FILE | snapcraft login --with - snapcraft -snapcraft upload --release=stable *.snap +if [RELEASE_TYPE = "rc"]; then + snapcraft upload --release=candidate *.snap +else + snapcraft upload --release=stable *.snap +fi snapcraft logout diff --git a/scripts/release-playstore.sh b/scripts/release-playstore.sh index 7ee2c1fe..ee53e445 100755 --- a/scripts/release-playstore.sh +++ b/scripts/release-playstore.sh @@ -1,4 +1,8 @@ #!/bin/sh -ve cd android -bundle exec fastlane deploy_release +if [RELEASE_TYPE = "rc"]; then + bundle exec fastlane deploy_candidate +else + bundle exec fastlane deploy_release +fi cd ..