fastlane-plugin-versioning 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fa4b9519e30c839ea63e93afdcff6c6331702cd
|
4
|
+
data.tar.gz: 5a9b5dd01541c8ac6bbcab2d70eed0cb4d55761b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680dcc55ce815871ff18a41dbe17b0d689742df9890c5dc45c6f233c6de3279d28faf3d2aba8d4d6ffe6f7a78783f1ce12875a128e5e1d681249f71eaba87368
|
7
|
+
data.tar.gz: a93ad8347af94d395d8fadb8cd45098e6789bb1ab4085f6d3b93c2186e61ec29c37f8e4ae59d1d965b6e3dfeb8ed88c8a730dc679e80bf6899b8050e79c5fa6f
|
data/README.md
CHANGED
@@ -66,6 +66,17 @@ version = get_app_store_version_number(bundle_id: 'com.apple.Numbers')
|
|
66
66
|
|
67
67
|
```
|
68
68
|
|
69
|
+
### get_version_number_from_git_branch
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
# Extracts version number from git branch name.
|
73
|
+
# `pattern` is pattern by which version number will be find, `#` is place where action must find version number.
|
74
|
+
# Default value is 'release-#'(for instance for branch name 'releases/release-1.5.0' will extract '1.5.0')
|
75
|
+
version = get_version_number_from_git_branch(pattern: 'release-#')
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
|
69
80
|
### get_info_plist_path
|
70
81
|
|
71
82
|
Get a path to target's Info.plist
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GetVersionNumberFromGitBranchAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
if Helper.test?
|
6
|
+
branch = 'releases/release-1.3.5'
|
7
|
+
else
|
8
|
+
branch = GitBranchAction.run
|
9
|
+
end
|
10
|
+
|
11
|
+
pattern = params[:pattern].dup
|
12
|
+
pattern["#"] = "(.*)"
|
13
|
+
|
14
|
+
match = Regexp.new(pattern).match(branch)
|
15
|
+
UI.user_error!("Cannot find version number in git branch '#{branch}' by pattern '#{params[:pattern]}'") unless match
|
16
|
+
match[1]
|
17
|
+
end
|
18
|
+
|
19
|
+
#####################################################
|
20
|
+
# @!group Documentation
|
21
|
+
#####################################################
|
22
|
+
|
23
|
+
def self.description
|
24
|
+
"Extract version number from git branch name"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.available_options
|
28
|
+
[
|
29
|
+
FastlaneCore::ConfigItem.new(key: :pattern,
|
30
|
+
env_name: "FL_VERSION_NUMBER_FROM_GIT_BRANCH_PATTERN",
|
31
|
+
description: "Pattern for branch name, should contain # character in place of version number",
|
32
|
+
default_value: 'release-#',
|
33
|
+
is_string: true)
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.authors
|
38
|
+
["SiarheiFedartsou"]
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.is_supported?(platform)
|
42
|
+
[:ios, :mac].include? platform
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-versioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siarhei Fiedartsou
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/fastlane/plugin/versioning.rb
|
78
78
|
- lib/fastlane/plugin/versioning/actions/get_app_store_version_number.rb
|
79
79
|
- lib/fastlane/plugin/versioning/actions/get_info_plist_path.rb
|
80
|
+
- lib/fastlane/plugin/versioning/actions/get_version_number_from_git_branch.rb
|
80
81
|
- lib/fastlane/plugin/versioning/actions/get_version_number_from_plist.rb
|
81
82
|
- lib/fastlane/plugin/versioning/actions/increment_version_number_in_plist.rb
|
82
83
|
- lib/fastlane/plugin/versioning/version.rb
|