fastlane-plugin-latest_play_store_version_code 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 4f04f7bd1be5f2eaed4f8928943577b8b82b4cf7abfb69a55b35de3d07c02349
4
- data.tar.gz: 12fe8eda7b4cca82daf3efc314b2ad92ce5cf32c4e402153f22adb8192cf9c34
3
+ metadata.gz: ccd3248c44fef1a2e7574a3202852885bcdb56081abe56d125ac4724e1886bf1
4
+ data.tar.gz: 3948348551fe650659babb7dae41ac5883e42bb888ab13bde2c0215037ac86ad
5
5
  SHA512:
6
- metadata.gz: 97290a1d2e1c73f6343b3f9b5d07012caabb4f2e877f5364c05138d59c2b793972c60a93e98c5d7c2349a90c3852cd01be4649b1317e37de159ca6ada1cb7f8c
7
- data.tar.gz: 7799adfdbbfa4f48a001857550b1c709a5cc00e1bcee33399a4ebbfc92526a47c5814ad691998f2c70bf5e28e17281ac6369c2a32386dbbabfcccfc7fa5f77f3
6
+ metadata.gz: 29f336ab62ea7ee9aab3d154c28ed896e95c54d647452c017db0d43a2662e2339d28461b5ed7bdb89288b6b45787e3c1ab2e4767298a83b48ce1e75f8eaf6892
7
+ data.tar.gz: d43eae042a345ea839dd04e7e105b3e88bbb5ab1a5406cc7ec93d223b03d3b0d7900134e3d05f44a3abffdac80577b888c77cfe82dd9ac4f8b3a3aa67e7774cc
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2022 Jørgen P. Tjernø <jorgen@tjer.no>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Jørgen P. Tjernø <jorgen@tjer.no>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,49 +1,49 @@
1
- # latest_play_store_version_code plugin
2
-
3
- [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-latest_play_store_version_code)
4
-
5
- ## Getting Started
6
-
7
- This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-latest_play_store_version_code`, add it to your project by running:
8
-
9
- ```bash
10
- fastlane add_plugin latest_play_store_version_code
11
- ```
12
-
13
- ## About latest_play_store_version_code
14
-
15
- Adds a latest_play_store_version_code action to fetch the latest Google Play Store version code for your project.
16
-
17
- ## Example
18
-
19
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin.
20
-
21
- ## Run tests for this plugin
22
-
23
- To run code style validation, run
24
-
25
- ```
26
- rake
27
- ```
28
-
29
- To automatically fix many of the styling issues, use
30
-
31
- ```
32
- rubocop -a
33
- ```
34
-
35
- ## Issues and Feedback
36
-
37
- For any other issues and feedback about this plugin, please submit it to this repository.
38
-
39
- ## Troubleshooting
40
-
41
- If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
42
-
43
- ## Using _fastlane_ Plugins
44
-
45
- For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
46
-
47
- ## About _fastlane_
48
-
49
- _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
1
+ # latest_play_store_version_code plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-latest_play_store_version_code)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-latest_play_store_version_code`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin latest_play_store_version_code
11
+ ```
12
+
13
+ ## About latest_play_store_version_code
14
+
15
+ Adds a latest_play_store_version_code action to fetch the latest Google Play Store version code for your project.
16
+
17
+ ## Example
18
+
19
+ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin.
20
+
21
+ ## Run tests for this plugin
22
+
23
+ To run code style validation, run
24
+
25
+ ```
26
+ rake
27
+ ```
28
+
29
+ To automatically fix many of the styling issues, use
30
+
31
+ ```
32
+ rubocop -a
33
+ ```
34
+
35
+ ## Issues and Feedback
36
+
37
+ For any other issues and feedback about this plugin, please submit it to this repository.
38
+
39
+ ## Troubleshooting
40
+
41
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
42
+
43
+ ## Using _fastlane_ Plugins
44
+
45
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
46
+
47
+ ## About _fastlane_
48
+
49
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -1,129 +1,132 @@
1
- require 'fastlane/action'
2
-
3
- module Fastlane
4
- module Actions
5
- module SharedValues
6
- LATEST_PLAY_STORE_VERSION_CODE = :LATEST_PLAY_STORE_VERSION_CODE
7
- LATEST_PLAY_STORE_RELEASE_NAME = :LATEST_PLAY_STORE_RELEASE_NAME
8
- end
9
-
10
- class LatestPlayStoreVersionCodeAction < Action
11
- def self.run(params)
12
- require 'supply'
13
- require 'supply/client'
14
-
15
- Supply.config = params
16
- client = Supply::Client.make_from_config
17
-
18
- client.begin_edit(package_name: Supply.config[:package_name])
19
- track = client.tracks.find { |track| track.track == params[:track] }
20
- client.abort_current_edit
21
-
22
- if track.nil?
23
- UI.error("Could not find the track #{params[:track]} on Google Play, do you need to upload a first build?")
24
- exit(1)
25
- end
26
-
27
- release_name = params[:release_name]
28
- if release_name
29
- release = track.releases.find { |release| release.name == release_name }
30
- release_message = "release #{release_name}"
31
- else
32
- release = track.releases.last
33
- release_message = "any releases"
34
- end
35
-
36
- if release.nil?
37
- UI.error("Could not find #{release_message} for #{params[:track]} on Google Play, do you need to upload a first build?")
38
- exit(1)
39
- end
40
-
41
- release_name = release.name
42
- latest_version_code = release.version_codes.last
43
- if latest_version_code.nil?
44
- if params[:initial_version_code].nil?
45
- UI.error("Could not find any version codes for #{release.name} (track '#{params[:track]}') on Google Play.")
46
- exit(1)
47
- else
48
- latest_version_code = params[:initial_version_code].to_s
49
- end
50
- end
51
-
52
- Actions.lane_context[SharedValues::LATEST_PLAY_STORE_VERSION_CODE] = latest_version_code.to_i
53
- Actions.lane_context[SharedValues::LATEST_PLAY_STORE_RELEASE_NAME] = release_name
54
- return Actions.lane_context[SharedValues::LATEST_PLAY_STORE_VERSION_CODE]
55
- end
56
-
57
- #####################################################
58
- # @!group Documentation
59
- #####################################################
60
-
61
- def self.description
62
- "Fetches most recent version code from the Google Play Store"
63
- end
64
-
65
- def self.details
66
- [
67
- "Provides a way to retrieve the latest version code & release name published to Google Play.",
68
- "Fetches the most recent version code from the given track on Google Play."
69
- ].join("\n")
70
- end
71
-
72
- def self.available_options
73
- require 'supply'
74
- require 'supply/options'
75
- options = Supply::Options.available_options.clone
76
-
77
- options_to_keep = [:package_name, :track, :json_key, :json_key_data, :key, :issuer, :root_url, :timeout]
78
- options.delete_if { |option| options_to_keep.include?(option.key) == false }
79
-
80
- options << FastlaneCore::ConfigItem.new(key: :release_name,
81
- env_name: "LATEST_RELEASE_NAME",
82
- description: "The release name whose latest version code we want",
83
- optional: true)
84
- options << FastlaneCore::ConfigItem.new(key: :initial_version_code,
85
- env_name: "INITIAL_VERSION_CODE",
86
- description: "sets the version code to given value if no release is found",
87
- default_value: 1,
88
- skip_type_validation: true) # allow Integer, String
89
- end
90
-
91
- def self.output
92
- [
93
- ['LATEST_PLAY_STORE_VERSION_CODE', 'The latest version code of the latest version of the app uploaded to Google Play'],
94
- ['LATEST_PLAY_STORE_RELEASE_NAME', 'The release name of the version code']
95
- ]
96
- end
97
-
98
- def self.return_value
99
- "Integer representation of the latest version code uploaded to Google Play Store"
100
- end
101
-
102
- def self.return_type
103
- :int
104
- end
105
-
106
- def self.authors
107
- ["jorgenpt"]
108
- end
109
-
110
- def self.is_supported?(platform)
111
- [:android].include?(platform)
112
- end
113
-
114
- def self.example_code
115
- [
116
- 'latest_play_store_version_code(release_name: "1.3")',
117
- ]
118
- end
119
-
120
- def self.sample_return_value
121
- 2
122
- end
123
-
124
- def self.category
125
- :production
126
- end
127
- end
128
- end
1
+ require 'fastlane/action'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ module SharedValues
6
+ LATEST_PLAY_STORE_VERSION_CODE = :LATEST_PLAY_STORE_VERSION_CODE
7
+ LATEST_PLAY_STORE_RELEASE_NAME = :LATEST_PLAY_STORE_RELEASE_NAME
8
+ end
9
+
10
+ class LatestPlayStoreVersionCodeAction < Action
11
+ def self.run(params)
12
+ require 'supply'
13
+ require 'supply/client'
14
+
15
+ Supply.config = params
16
+ client = Supply::Client.make_from_config
17
+
18
+ client.begin_edit(package_name: Supply.config[:package_name])
19
+ track = client.tracks.find { |track| track.track == params[:track] }
20
+ client.abort_current_edit
21
+
22
+ if track.nil?
23
+ UI.error("Could not find the track #{params[:track]} on Google Play, do you need to upload a first build?")
24
+ exit(1)
25
+ end
26
+
27
+ release_name = params[:release_name]
28
+ if release_name
29
+ release = track.releases.find { |release| release.name == release_name }
30
+ releases = if release.nil? then [] else [release] end
31
+ release_message = "release #{release_name}"
32
+ else
33
+ releases = track.releases
34
+ release_message = "any releases"
35
+ end
36
+
37
+ if releases.empty?
38
+ UI.error("Could not find #{release_message} for #{params[:track]} on Google Play, do you need to upload a first build?")
39
+ exit(1)
40
+ end
41
+
42
+ release = releases.max { |a, b| a.version_codes.map(&:to_i).max <=> b.version_codes.map(&:to_i).max }
43
+
44
+ release_name = release.name
45
+ latest_version_code = release.version_codes.map(&:to_i).max
46
+ if latest_version_code.nil?
47
+ if params[:initial_version_code].nil?
48
+ UI.error("Could not find any version codes for #{release.name} (track '#{params[:track]}') on Google Play.")
49
+ exit(1)
50
+ else
51
+ latest_version_code = params[:initial_version_code].to_i
52
+ end
53
+ end
54
+
55
+ Actions.lane_context[SharedValues::LATEST_PLAY_STORE_VERSION_CODE] = latest_version_code
56
+ Actions.lane_context[SharedValues::LATEST_PLAY_STORE_RELEASE_NAME] = release_name
57
+ return Actions.lane_context[SharedValues::LATEST_PLAY_STORE_VERSION_CODE]
58
+ end
59
+
60
+ #####################################################
61
+ # @!group Documentation
62
+ #####################################################
63
+
64
+ def self.description
65
+ "Fetches most recent version code from the Google Play Store"
66
+ end
67
+
68
+ def self.details
69
+ [
70
+ "Provides a way to retrieve the latest version code & release name published to Google Play.",
71
+ "Fetches the most recent version code from the given track on Google Play."
72
+ ].join("\n")
73
+ end
74
+
75
+ def self.available_options
76
+ require 'supply'
77
+ require 'supply/options'
78
+ options = Supply::Options.available_options.clone
79
+
80
+ options_to_keep = [:package_name, :track, :json_key, :json_key_data, :key, :issuer, :root_url, :timeout]
81
+ options.delete_if { |option| options_to_keep.include?(option.key) == false }
82
+
83
+ options << FastlaneCore::ConfigItem.new(key: :release_name,
84
+ env_name: "LATEST_RELEASE_NAME",
85
+ description: "The release name whose latest version code we want",
86
+ optional: true)
87
+ options << FastlaneCore::ConfigItem.new(key: :initial_version_code,
88
+ env_name: "INITIAL_VERSION_CODE",
89
+ description: "sets the version code to given value if no release is found",
90
+ default_value: 1,
91
+ skip_type_validation: true) # allow Integer, String
92
+ end
93
+
94
+ def self.output
95
+ [
96
+ ['LATEST_PLAY_STORE_VERSION_CODE', 'The latest version code of the latest version of the app uploaded to Google Play'],
97
+ ['LATEST_PLAY_STORE_RELEASE_NAME', 'The release name of the version code']
98
+ ]
99
+ end
100
+
101
+ def self.return_value
102
+ "Integer representation of the latest version code uploaded to Google Play Store"
103
+ end
104
+
105
+ def self.return_type
106
+ :int
107
+ end
108
+
109
+ def self.authors
110
+ ["jorgenpt"]
111
+ end
112
+
113
+ def self.is_supported?(platform)
114
+ [:android].include?(platform)
115
+ end
116
+
117
+ def self.example_code
118
+ [
119
+ 'latest_play_store_version_code(release_name: "1.3")',
120
+ ]
121
+ end
122
+
123
+ def self.sample_return_value
124
+ 2
125
+ end
126
+
127
+ def self.category
128
+ :production
129
+ end
130
+ end
131
+ end
129
132
  end
@@ -1,5 +1,5 @@
1
- module Fastlane
2
- module LatestPlayStoreVersionCode
3
- VERSION = "0.1.2"
4
- end
5
- end
1
+ module Fastlane
2
+ module LatestPlayStoreVersionCode
3
+ VERSION = "0.1.3"
4
+ end
5
+ end
@@ -1,16 +1,16 @@
1
- require 'fastlane/plugin/latest_play_store_version_code/version'
2
-
3
- module Fastlane
4
- module LatestPlayStoreVersionCode
5
- # Return all .rb files inside the "actions" and "helper" directory
6
- def self.all_classes
7
- Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
- end
9
- end
10
- end
11
-
12
- # By default we want to import all available actions and helpers
13
- # A plugin can contain any number of actions and plugins
14
- Fastlane::LatestPlayStoreVersionCode.all_classes.each do |current|
15
- require current
16
- end
1
+ require 'fastlane/plugin/latest_play_store_version_code/version'
2
+
3
+ module Fastlane
4
+ module LatestPlayStoreVersionCode
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::LatestPlayStoreVersionCode.all_classes.each do |current|
15
+ require current
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-latest_play_store_version_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jørgen P. Tjernø
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-24 00:00:00.000000000 Z
11
+ date: 2022-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description:
153
+ description:
154
154
  email: jorgen@tjer.no
155
155
  executables: []
156
156
  extensions: []
@@ -165,7 +165,7 @@ homepage: https://github.com/jorgenpt/fastlane-plugin-latest_play_store_version_
165
165
  licenses:
166
166
  - MIT
167
167
  metadata: {}
168
- post_install_message:
168
+ post_install_message:
169
169
  rdoc_options: []
170
170
  require_paths:
171
171
  - lib
@@ -180,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubygems_version: 3.3.7
184
- signing_key:
183
+ rubygems_version: 3.0.3.1
184
+ signing_key:
185
185
  specification_version: 4
186
186
  summary: Adds a latest_play_store_version_code action to fetch the latest Google Play
187
187
  Store version code for your project.