From 99c30229fae77b220398f1fc84232a8aba82a472 Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Wed, 4 Nov 2026 11:55:19 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'fastlane/'?= =?UTF-8?q?=20with=20remote=20'config/fastlane/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- fastlane/Pluginfile | 5 ++ fastlane/Pluginfile.license | 2 + fastlane/common.Fastfile | 123 ++++++++++++++++++++++++++++-------- 3 files changed, 102 insertions(+), 28 deletions(-) create mode 100644 fastlane/Pluginfile create mode 100644 fastlane/Pluginfile.license diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile new file mode 100644 index 000000000..67ece5837 --- /dev/null +++ b/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-huawei_appgallery_connect' diff --git a/fastlane/Pluginfile.license b/fastlane/Pluginfile.license new file mode 100644 index 000000000..bad88886d --- /dev/null +++ b/fastlane/Pluginfile.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/fastlane/common.Fastfile b/fastlane/common.Fastfile index 9dae3f1c1..587310c03 100644 --- a/fastlane/common.Fastfile +++ b/fastlane/common.Fastfile @@ -2,6 +2,7 @@ # cd fastlane # bundle config set path fastlane # bundle install +# bundle exec fastlane add_plugin huawei_appgallery_connect # run fastlane # bundle exec fastlane @@ -41,6 +42,23 @@ platform :android do buildBundle() buildAPKs(code: versionInfo["versionCode"]) end + + desc "Release phase 2: checks, tag, create GH release, upload to appstores" + lane :releasePhase2 do + versionInfo = getVersionInfo() + versionComponents = parseVersionCode(versionInfo) + checkReleasable(versionComponents) + storeTrack = getPlayStoreTrack(versionComponents) + isPrerelease = isPrerelease(versionComponents) + tagName = getTagName(versionComponents) + preReleaseChecks(versionInfo: versionInfo, tagName: tagName, type: versionComponents["type"], track: storeTrack, isPrerelease: isPrerelease) + checkArtifactsExist() + repoSpecificChecks(isPrerelease: isPrerelease) # needs to be overwritten in apps + tag(name: tagName) + createGithubRelease(name: versionInfo["versionName"], tag: tagName, versionCode: versionInfo["versionCode"], isPrerelease: isPrerelease) + uploadToPlayStore(track: storeTrack) + uploadToHuawei(versionCode: versionInfo["versionCode"], isPrerelease: isPrerelease) + end desc "Print version info" lane :printVersionInfo do @@ -112,8 +130,6 @@ platform :android do type end - - desc "Generate versionCode from version components" private_lane :generateVersionCode do |versionComponents| puts "Generating version code from #{versionComponents}" @@ -153,10 +169,10 @@ platform :android do desc "Write versions to gradle file" private_lane :writeVersions do |options| - File.open("../app/build.gradle","r+") do |file| + File.open("../app/build.gradle.kts","r+") do |file| text = file.read - text.gsub!(/versionName "(.*)"$/, "versionName \"#{options[:versionName]}\"") - text.gsub!(/versionCode ([0-9]*)$/, "versionCode #{options[:versionCode]}") + text.gsub!(/versionName = "(.*)"$/, "versionName = \"#{options[:versionName]}\"") + text.gsub!(/versionCode = ([0-9]*)$/, "versionCode = #{options[:versionCode]}") file.rewind file.write(text) file.truncate(file.pos) @@ -228,6 +244,18 @@ platform :android do UI.user_error!("Version is not releasable: #{versionComponents["type"]}") end end + + desc "check if release is a prerelease" + private_lane :isPrerelease do |versionComponents| + case versionComponents["type"] + when TYPE_RC + isPrerelease = true + when TYPE_FINAL + isPrerelease = false + else + UI.user_error!("Version is not releasable: #{versionComponents["type"]}") + end + end desc "Build app bundle" private_lane :buildBundle do @@ -237,7 +265,7 @@ platform :android do build_type: 'Release', print_command: false, properties: GRADLE_SIGNING_PROPERTIES - ) + ) end desc "Build signed APK" @@ -264,32 +292,71 @@ platform :android do end desc "Create release tag" - private_lane :tag do |options| - tagName = options[:name] - add_git_tag( - tag: tagName, - sign: true - ) - push_git_tags(tag: tagName) - end + private_lane :tag do |options| + tagName = options[:name] + add_git_tag( + tag: tagName, + sign: true + ) + push_git_tags(tag: tagName) + end - desc "Upload release artifacts to Google Play" - private_lane :uploadToPlayStore do |options| - upload_to_play_store( - skip_upload_images: true, - skip_upload_apk: true, - track: options[:track], - aab: BUNDLE_PATH - ) - end + desc "Upload release artifacts to Google Play" + private_lane :uploadToPlayStore do |options| + upload_to_play_store( + skip_upload_images: true, + skip_upload_apk: true, + track: options[:track], + aab: BUNDLE_PATH + ) + end - desc "Check if release artifacts exist" - private_lane :checkArtifactsExist do - if !File.exist?("../#{BUNDLE_PATH}") - UI.user_error!("Bundle not found at #{BUNDLE_PATH}") - end + desc "Check if release artifacts exist" + private_lane :checkArtifactsExist do + if !File.exist?("../#{BUNDLE_PATH}") + UI.user_error!("Bundle not found at #{BUNDLE_PATH}") end + end + + desc "Show versions and prompt for confirmation" + private_lane :preReleaseChecks do |options| + versionInfo = options[:versionInfo] + tagName = options[:tagName] + currentBranch = git_branch() + text = "Version code: #{versionInfo["versionCode"]}\n" + + "Version name: #{versionInfo["versionName"]}\n" + + "Current branch: #{currentBranch}\n" + + "Version type: #{options[:type]}\n" + + "Tag: #{tagName}\n" + + "Track: #{options[:track]}\n" + + "Prerelease: #{options[:isPrerelease]}" + promptYesNo(text: text) + end + private_lane :createGithubRelease do |options| + set_github_release( + repository_name: REPO, + api_token: ENV["FASTLANE_NEXTCLOUD_GITHUB_API_TOKEN"], + name: options[:name], + is_prerelease: options[:isPrerelease], + tag_name: options[:tag], + description: (File.read("metadata/android/en-US/changelogs/" + options[:versionCode] + ".txt") rescue "No changelog provided"), + upload_assets: Dir.glob("release/*.apk") + ) + end + + private_lane :uploadToHuawei do |options| + if APP == "files" && options[:isPrerelease] == false + huawei_appgallery_connect( + client_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID"], + client_secret: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET"], + app_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_APP_ID"], + apk_path: "release/nextcloud-#{APP}-huawei-#{options[:versionCode]}.apk", + submit_for_review: true, + delay_before_submit_for_review: 30, + ) + end + end end private_lane :promptYesNo do |options| From f3730a69550db8ea38842b828a6627506acc92fa Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Wed, 4 Nov 2026 11:55:20 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.'=20with?= =?UTF-8?q?=20remote=20'config/root/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- Gemfile | 3 ++ Gemfile.lock | 78 +++++++++++++++++++++++++--------------------------- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/Gemfile b/Gemfile index e8468385f..1642e64e8 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,6 @@ source "https://rubygems.org" gem "fastlane" gem "abbrev" + +plugins_path = File.join(File.dirname(__FILE__), '.', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index dc1f5ded0..0584204f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,10 +7,10 @@ GEM public_suffix (>= 2.0.2, < 8.0) artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.4.1) - aws-partitions (1.1299.1) - aws-sdk-core (3.262.0) - aws-eventstream (~> 1, >= 1.4.1) + aws-eventstream (1.4.0) + aws-partitions (1.1290.0) + aws-sdk-core (3.257.0) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) base64 @@ -18,11 +18,11 @@ GEM jmespath (~> 1, >= 1.6.1) logger rexml (~> 3.4, >= 3.4.2) - aws-sdk-kms (1.137.0) - aws-sdk-core (~> 3, >= 3.262.0) + aws-sdk-kms (1.132.0) + aws-sdk-core (~> 3, >= 3.256.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.236.0) - aws-sdk-core (~> 3, >= 3.262.0) + aws-sdk-s3 (1.232.2) + aws-sdk-core (~> 3, >= 3.256.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) @@ -37,17 +37,18 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - csv (3.3.7) + csv (3.3.6) declarative (0.0.20) digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) - domain_name (0.7.20261007) + domain_name (0.6.20260921) dotenv (2.8.1) emoji_regex (3.2.3) erb (6.0.7) - excon (1.9.1) - faraday (2.15.1) - faraday-net_http (>= 2.0, < 3.6) + excon (1.7.1) + logger + faraday (2.14.4) + faraday-net_http (>= 2.0, < 3.5) json logger faraday-cookie_jar (0.0.8) @@ -57,12 +58,12 @@ GEM faraday (>= 1, < 3) faraday-multipart (1.2.0) multipart-post (~> 2.0) - faraday-net_http (3.5.0) + faraday-net_http (3.4.4) net-http (~> 0.5) faraday-retry (2.4.0) faraday (~> 2.0) - fastimage (2.4.3) - fastlane (2.241.2) + fastimage (2.4.1) + fastlane (2.240.1) CFPropertyList (>= 2.3, < 5.0.0) abbrev (~> 0.1) addressable (>= 2.9.0, < 3.0.0) @@ -78,8 +79,7 @@ GEM csv (~> 3.3) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) - erb (>= 4.0, < 7.0) - excon (>= 1.0.0, < 2.0.0) + excon (>= 0.71.0, < 2.0.0) faraday (~> 2.7) faraday-cookie_jar (~> 0.0.8) faraday-follow_redirects (~> 0.3) @@ -90,7 +90,7 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.99) google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-env (>= 1.6.0, < 2.5.0) + google-cloud-env (>= 1.6.0, < 2.4.0) google-cloud-storage (~> 1.31) highline (~> 2.0) irb (>= 1.8) @@ -109,7 +109,7 @@ GEM rubyzip (>= 3.4.0, < 4.0.0) security (~> 0.3) simctl (~> 1.6.3) - terminal-notifier (>= 3.1.0, < 4.0.0) + terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (~> 4) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) @@ -119,9 +119,9 @@ GEM xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-sirp (1.1.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.110.0) + google-apis-androidpublisher_v3 (0.109.0) google-apis-core (>= 0.15.0, < 2.a) - google-apis-core (1.4.0) + google-apis-core (1.2.5) addressable (~> 2.9) faraday (~> 2.13) faraday-follow_redirects (~> 0.3) @@ -134,16 +134,16 @@ GEM google-apis-core (>= 0.15.0, < 2.a) google-apis-playcustomapp_v1 (0.18.0) google-apis-core (>= 0.15.0, < 2.a) - google-apis-storage_v1 (0.70.0) + google-apis-storage_v1 (0.68.0) google-apis-core (>= 0.15.0, < 2.a) google-cloud-core (1.9.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (2.4.1) + google-cloud-env (2.3.1) base64 (~> 0.2) faraday (>= 1.0, < 3.a) google-cloud-errors (1.7.0) - google-cloud-storage (1.62.1) + google-cloud-storage (1.62.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-core (>= 0.18, < 2) @@ -152,8 +152,8 @@ GEM google-cloud-core (~> 1.6) googleauth (~> 1.9) mini_mime (~> 1.0) - google-logging-utils (0.2.1) - googleauth (1.17.6) + google-logging-utils (0.2.0) + googleauth (1.17.4) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.2) google-logging-utils (~> 0.1) @@ -164,7 +164,7 @@ GEM highline (2.0.3) http-cookie (1.1.6) domain_name (~> 0.5) - io-console (0.9.5) + io-console (0.9.4) irb (1.18.0) pp (>= 0.6.0) prism (>= 1.3.0) @@ -182,11 +182,8 @@ GEM mutex_m (0.3.0) nanaimo (0.4.0) naturally (2.3.0) - net-http (0.10.0) - net-protocol (>= 0.3.0) + net-http (0.9.1) uri (>= 0.11.1) - net-protocol (0.4.0) - timeout nkf (0.3.0) optparse (0.8.1) os (1.1.4) @@ -194,23 +191,23 @@ GEM plist (3.7.2) pp (0.6.4) prettyprint - prettyprint (0.2.1) + prettyprint (0.2.0) prism (1.9.0) - pstore (0.3.0) + pstore (0.2.1) public_suffix (7.0.5) rake (13.4.2) rbs (4.2.0) logger prism (>= 1.6.0) tsort - rdoc (8.1.0) + rdoc (8.0.0) erb prism (>= 1.6.0) rbs (>= 4.0.0) tsort reline (0.7.0) io-console (~> 0.5) - representable (3.3.1) + representable (3.3.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) @@ -218,18 +215,17 @@ GEM rexml (3.4.4) rouge (3.28.0) rubyzip (3.7.0) - security (0.4.0) - signet (0.22.1) + security (0.3.0) + signet (0.22.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 4.0) simctl (1.6.10) CFPropertyList naturally - terminal-notifier (3.1.0) + terminal-notifier (2.0.0) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - timeout (0.6.1) trailblazer-option (0.1.2) tsort (0.2.0) tty-cursor (0.7.1) @@ -240,7 +236,7 @@ GEM unicode-display_width (3.3.0) unicode-emoji (~> 4.3) unicode-emoji (4.3.0) - uri (1.1.2) + uri (1.1.1) word_wrap (1.0.0) xcodeproj (1.28.1) CFPropertyList (>= 2.3.3, < 4.0)