fastlane-plugin-semantic_versioning 3.1.0 → 3.2.0

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: c69829beea0aa401b5fb31cc490ebecf7d49ffa0430a8c5bc43e05a68c29ef63
4
- data.tar.gz: 71135c35e0b72fa387f3061dfc64ec6708035678ff335f7d465ab22d588942f8
3
+ metadata.gz: e98de4e63d8464ac45f677299cd4770631f19e98e2c9b50fbed75fb2e1a34137
4
+ data.tar.gz: c870636105b753ad4283a7b258f954f93b7e8b757f3ebccf4ef4db20a8918204
5
5
  SHA512:
6
- metadata.gz: 52bd6b35613e1369344ca83c53d0fca579e288413e9d1637f3205abbbf3c00003e158ee785d4c58bc1c29a3383dd4bf8b35c31c0886ace96bac3857e810f3aea
7
- data.tar.gz: f0c43b718ddb28d6ca01f4766dc33a05c729b3a0438050798bb2ec2b09f6515bc28e407986789fb1c231d56c54744b056c53d345d92190ed7dc8fb2fdb7f51d2
6
+ metadata.gz: b2ca77ff9d828db81747bcb742936e1a381e3e9aeb8c85fcdcf1ac54975a814439b13328faa55406957ad7ce7e98e4ebd46ae83159310eaf5be930841650193a
7
+ data.tar.gz: 89e91142c4c7553f0057e6f5e13a3343098c53de50ebf2fb5a66dd8c5df7d5520fa287ab32adffc5e6cdd2610eb68840132deac43fb7c0d78d7b117d9eb9ccb7
@@ -24,32 +24,34 @@ module Fastlane
24
24
  params[:bump_map].transform_values!(&:to_sym)
25
25
  params[:force_type] = params[:force_type]&.to_sym
26
26
 
27
- verify_type_map(params[:type_map])
28
- verify_bump_map(params[:bump_map])
29
- Helper::SemanticVersioningHelper.verify_versioning_system(params[:versioning_system])
30
-
31
27
  system = lane_context[SharedValues::SEMVER_VERSIONING_SYSTEM] = params[:versioning_system]
32
- target = params[:target]
28
+ tag_format = params[:tag_format]
33
29
 
34
- current_version = if params[:update]
35
- Helper::SemanticVersioningHelper.previous_version(tag_format: params[:tag_format])
36
- else
37
- Helper::SemanticVersioningHelper.version_number(system: system, target: target)
38
- end
39
- formatted_tag = Helper::SemanticVersioningHelper.formatted_tag(current_version, params[:tag_format])
30
+ current_version = Helper::SemanticVersioningHelper.current_version(
31
+ tag_format: tag_format,
32
+ update: params[:update],
33
+ system: system,
34
+ target: params[:target]
35
+ )
36
+ formatted_tag = Helper::SemanticVersioningHelper.formatted_tag(current_version, tag_format)
37
+ UI.message("Current version: #{current_version} (#{formatted_tag})")
40
38
 
41
39
  commits = Helper::SemanticVersioningHelper.git_commits(
42
40
  from: Helper::SemanticVersioningHelper.git_tag_exists?(formatted_tag) ? formatted_tag : nil,
43
41
  allowed_types: params[:allowed_types],
44
42
  bump_map: params[:bump_map]
45
43
  )
44
+ UI.message("Found #{commits.length} commit#{commits.length == 1 ? 's' : ''} from last version tag")
46
45
 
47
46
  bump_type = Helper::SemanticVersioningHelper.bump_type(commits: commits, force_type: params[:force_type])
47
+ bump_type ||= Helper::SemanticVersioningHelper.manual_bump_type(skip_manual: params[:skip_manual_bump])
48
+
48
49
  new_version = Helper::SemanticVersioningHelper.increase_version(current_version: current_version,
49
50
  bump_type: bump_type)
50
51
  new_changelog = Helper::SemanticVersioningHelper.build_changelog(version: new_version, commits: commits,
51
52
  type_map: params[:type_map])
52
53
  bumpable = current_version != new_version
54
+ UI.message("New version: #{new_version}") if bumpable
53
55
 
54
56
  Actions.lane_context[SharedValues::SEMVER_CURRENT_VERSION] = current_version
55
57
  Actions.lane_context[SharedValues::SEMVER_CURRENT_TAG] = formatted_tag
@@ -115,6 +117,12 @@ module Fastlane
115
117
  optional: true,
116
118
  default_value: nil,
117
119
  type: String),
120
+ FastlaneCore::ConfigItem.new(key: :skip_manual_bump,
121
+ env_name: "SEMANTIC_VERSIONING_SKIP_MANUAL_BUMP",
122
+ description: "When set, no interactive prompt is shown when there's no version to bump",
123
+ optional: true,
124
+ default_value: false,
125
+ is_string: false),
118
126
  FastlaneCore::ConfigItem.new(key: :tag_format,
119
127
  env_name: "SEMANTIC_VERSIONING_TAG_FORMAT",
120
128
  description: "The format for the git tag",
@@ -31,6 +31,14 @@ module Fastlane
31
31
  end
32
32
  end
33
33
 
34
+ def self.current_version(tag_format:, update:, system:, target:)
35
+ if update
36
+ Helper::SemanticVersioningHelper.previous_version(tag_format: tag_format)
37
+ else
38
+ Helper::SemanticVersioningHelper.version_number(system: system, target: target)
39
+ end
40
+ end
41
+
34
42
  def self.previous_version(tag_format:)
35
43
  tag = Fastlane::Actions::LastGitTagAction.run(pattern: tag_format.sub("$version", "[0-9].[0-9].[0-9]"))
36
44
  return "0.0.0" if tag.empty?
@@ -112,6 +120,17 @@ module Fastlane
112
120
  result
113
121
  end
114
122
 
123
+ def self.manual_bump_type(skip_manual:)
124
+ return if skip_manual
125
+
126
+ UI.message("No new version to bump")
127
+ if !Helper.test? && UI.interactive?
128
+ return UI.select("If you do want to create a new version, select which type:", [:major, :minor, :patch, nil])
129
+ end
130
+
131
+ nil
132
+ end
133
+
115
134
  def self.group_commits(commits:, allowed_types:)
116
135
  result = allowed_types.to_h { |type| [type, []] }
117
136
  result[:none] = []
@@ -200,7 +219,7 @@ module Fastlane
200
219
  end
201
220
 
202
221
  def self.git_tag_exists?(tag)
203
- git.tags.include?(tag)
222
+ git.tags.map(&:name).include?(tag)
204
223
  end
205
224
 
206
225
  def self.project(path = nil)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module SemanticVersioning
5
- VERSION = "3.1.0"
5
+ VERSION = "3.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-semantic_versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karsten Silkenbäumer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2026-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane-plugin-versioning
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.24'
55
- description:
55
+ description:
56
56
  email: 993392+kassi@users.noreply.github.com
57
57
  executables: []
58
58
  extensions: []
@@ -71,7 +71,7 @@ licenses:
71
71
  - MIT
72
72
  metadata:
73
73
  rubygems_mfa_required: 'true'
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubygems_version: 3.4.10
90
- signing_key:
90
+ signing_key:
91
91
  specification_version: 4
92
92
  summary: Version and changelog management following semver and conventional commits.
93
93
  test_files: []