fastlane-plugin-auto_version_name 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f10a1f69013f98b7eed2528d10c4752aebbb4f4e724d49d89f0f8f9ae5d7588
4
- data.tar.gz: cc11ee12661f56ed7edefdb21761a585922756b80874f37b5968c0f3c7db5b8f
3
+ metadata.gz: c03a05852b393a0b7c8dee4d0a3402f77bc0730cae5d204be093f8df272655e8
4
+ data.tar.gz: 85703702e8bbc9991d432dab68d06b41322b1049caf86ca9e4880b649ed51099
5
5
  SHA512:
6
- metadata.gz: cce9bdf292e20c825da20d7df50d831032df7fb7742937e436efd7be56c7caa04965da9b30af6e1742f1d26d31276b1c0784300a09ce3b2315c005f3c6f2dadd
7
- data.tar.gz: fc8f0069976b00b910b909a9136f6f31696ed111f0fd2f67d28fb35a3cc5b578be544eafbd696633b29d0075c50af560a43f9325eb4b2b0470109fc09a2741e1
6
+ metadata.gz: 8465f2faef334286a29aa4c8c3693e40fc356305be8df3228fc99ff95719f5003c4ca0bf753bf8d8f78589a13c8ca310cdda51e2fceafa9cfda44fc61cb6b7b6
7
+ data.tar.gz: 836d28fe548ba473138fe336d3f65442e66e24f9983b4917fb9a43d89a731bc7eaedba24a3fcde0eefc632af058b1573c0ccc8940c665882fa07816cd9ae4969
data/README.md CHANGED
@@ -160,6 +160,8 @@ end
160
160
 
161
161
  - The base version will always be the largest among the options passed as a parameter. Version comparison uses [Gem::Version](https://ruby-doc.org/stdlib-2.5.0/libdoc/rubygems/rdoc/Gem/Version.html#method-i-3C-3D-3E).
162
162
 
163
+ - `abort_in_hotfix_reviewing` will stop the fastlane process if App Store Connect is reviewing a hotfix version (status is Waiting fo Review or In Review, and version name's `patch` number is greater than 0). Default value is `true`.
164
+
163
165
  ## Run tests for this plugin
164
166
 
165
167
  To run both the tests, and code style validation, run
@@ -7,6 +7,7 @@ module Fastlane
7
7
  def self.run(params)
8
8
  # INITIALIZE
9
9
  branch = Actions.git_branch()
10
+ default_platform = lane_context[SharedValues::DEFAULT_PLATFORM]
10
11
  last_commit_message = Actions.last_git_commit_message()
11
12
  final_version_array = []
12
13
  final_version_string = ""
@@ -62,6 +63,28 @@ module Fastlane
62
63
  rescue => exception
63
64
  puts exception
64
65
  ios_version_string = minimal_version_string
66
+ ensure
67
+ if (default_platform == :ios)
68
+ platform = Spaceship::ConnectAPI::Platform.map("ios")
69
+ app = Spaceship::ConnectAPI::App.find(params[:ios_app_identifier])
70
+ latest_version = app.get_latest_app_store_version(platform: platform)
71
+
72
+ v_state = latest_version.app_store_state
73
+ v_name = latest_version.version_string
74
+ v_name_array = v_name.split('.').map { |value| value.to_i }
75
+
76
+ can_abort = params[:abort_in_hotfix_reviewing]
77
+
78
+ if ((v_state == "WAITING_FOR_REVIEW" || v_state == "IN_REVIEW") && v_name_array.last > 0)
79
+ message = "App Store Connect is processing a hotfix! [Version: #{v_name} / Status: #{v_state}]"
80
+ if (can_abort)
81
+ UI.error message
82
+ exit(false)
83
+ else
84
+ UI.important message
85
+ end
86
+ end
87
+ end
65
88
  end
66
89
 
67
90
  # ANDROID
@@ -205,6 +228,14 @@ module Fastlane
205
228
  ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
206
229
  end
207
230
  ),
231
+ FastlaneCore::ConfigItem.new(
232
+ key: :abort_in_hotfix_reviewing,
233
+ env_name: "ABORT_IN_HOTFIX_REVIEWING",
234
+ description: "Whether should exit the process if App Store Connect is reviewing a hotfix (iOS platform only)",
235
+ optional: true,
236
+ default_value: true,
237
+ type: Object
238
+ ),
208
239
  ]
209
240
  end
210
241
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AutoVersionName
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-auto_version_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gileadeteixeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-30 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler