fastlane-plugin-google_play_versions 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2e5f14a8068ab6280b477950d5e497760f9a212d62c5d638da91fd79a3911999
4
+ data.tar.gz: 9f0048fb0832fc7b65728cc9734e653f483dfeeeb25e8664cc34f992566dee43
5
+ SHA512:
6
+ metadata.gz: 474a7c4b51e83937d998285d57fccd14b183b6ef11ab87898f82e90176073d2ae091de7888cc4ca5fcecdabc3d8b5a81712803f88f7e2828fd26a792fdcb3d32
7
+ data.tar.gz: 6adb4fec4c440177f208c773c1076c82233923529c315966bc21cfa9945f20b2dbc2f28bca253606bfec72c672feaa8700cf1cebec4eeb07c0084bde8668109e
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025
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 ADDED
@@ -0,0 +1,45 @@
1
+ # fastlane-plugin-google_play_versions
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-google_play_versions)
4
+
5
+ Simple [fastlane](https://fastlane.tools/) plugin to fetch build version codes from a Play Store track, including rollout releases that have been halted or app bundles that have been archived.
6
+
7
+ ## Getting Started
8
+
9
+ Add the plugin to your project:
10
+
11
+ ```bash
12
+ bundle exec fastlane add_plugin google_play_versions
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ruby
18
+ lane :release do
19
+ track_version_code = google_play_track_version_code(
20
+ package_name: package_name,
21
+ track: google_play_track
22
+ )
23
+ android_set_version_code(version_code: track_version_code + 1)
24
+ end
25
+ ```
26
+
27
+ The action will use Supply under the hood to connect to the Play Store and lookup the highest build version code for the specified track.
28
+
29
+ ### Available options
30
+
31
+ | Option | Description | Default |
32
+ |----------------|-----------------------------------------------------|-----------|
33
+ | `package_name` | The package name of the application to use | current directory |
34
+ | `track` | The track of the application to use. The default available tracks are: production, beta, alpha, internal | `production` |
35
+
36
+ Run `bundle exec fastlane action google_play_versions` for details.
37
+
38
+ ## Development
39
+
40
+ 1. Run `bundle install` to install dependencies.
41
+ 2. Use `bundle exec rspec` to run the test suite.
42
+
43
+ ## Issues and Contributions
44
+
45
+ Please create a GitHub issue if you run into a problem or have a feature request. Pull requests are always welcome.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "standard/rake"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task default: [:spec]
@@ -0,0 +1,3 @@
1
+ # Autogenerated by fastlane. Edit cautiously, file is used to manage plugin dependencies.
2
+
3
+ gem "fastlane-plugin-google_play_versions", path: "../"
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class GooglePlayTrackVersionCodeAction < Action
6
+ # Supply::Options.available_options keys that apply to this action.
7
+ OPTIONS = [
8
+ :package_name,
9
+ :track,
10
+ :key,
11
+ :issuer,
12
+ :json_key,
13
+ :json_key_data,
14
+ :root_url,
15
+ :timeout
16
+ ]
17
+
18
+ def self.run(params)
19
+ config = params || FastlaneCore::Configuration.create(available_options, {})
20
+ track_version_codes = other_action.google_play_track_version_codes(
21
+ package_name: params[:package_name],
22
+ track: params[:track]
23
+ )
24
+ aab_version_codes = Helper::GooglePlayVersionsHelper.aab_version_codes(config)
25
+ version_code = (track_version_codes + aab_version_codes).max
26
+ UI.success("Found '#{version_code}' as the latest version code on the '#{params[:track]}' track")
27
+ version_code
28
+ end
29
+
30
+ def self.description
31
+ "Fetch the most recent build version code from a Play Store track from within Fastlane."
32
+ end
33
+
34
+ def self.details
35
+ "Use this action to fetch the highest build version code from a Play Store track, including version codes from builds that are archived."
36
+ end
37
+
38
+ def self.return_value
39
+ "Integer with the latest build version code (integer or nil)"
40
+ end
41
+
42
+ def self.authors
43
+ ["Nuno Pinge"]
44
+ end
45
+
46
+ def self.available_options
47
+ require "supply"
48
+ require "supply/options"
49
+
50
+ Supply::Options.available_options.select do |option|
51
+ OPTIONS.include?(option.key)
52
+ end
53
+ end
54
+
55
+ def self.example_code
56
+ [
57
+ 'google_play_track_version_code(
58
+ package_name: \'com.example\',
59
+ track: \'production\'
60
+ )'
61
+ ]
62
+ end
63
+
64
+ def self.is_supported?(platform)
65
+ platform == :android
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "supply"
4
+ require "supply/client"
5
+
6
+ module Fastlane
7
+ module Helper
8
+ class GooglePlayVersionsHelper
9
+ def self.aab_version_codes(params)
10
+ Supply.config = params
11
+ client = Supply::Client.make_from_config
12
+ client.begin_edit(package_name: Supply.config[:package_name])
13
+ version_codes = client.aab_version_codes
14
+ client.abort_current_edit
15
+ if version_codes.empty?
16
+ UI.important("No version codes found on '#{params[:track]}' track for #{params[:package_name]}")
17
+ else
18
+ UI.message("Found '#{version_codes.max} ... #{version_codes.min}' version codes on '#{params[:track]}' track (#{version_codes.size})")
19
+ end
20
+ version_codes
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fastlane
4
+ module GooglePlayVersions
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane/plugin/google_play_versions/version"
4
+
5
+ module Fastlane
6
+ module GooglePlayVersions
7
+ # Autoload all Ruby files in actions and helper directories
8
+ def self.all_classes
9
+ Dir[File.expand_path("**/{actions,helper}/*.rb", __dir__)].sort.each do |file|
10
+ require file
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ Fastlane::GooglePlayVersions.all_classes
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-google_play_versions
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nuno Pinge
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fastlane
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.96.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.96.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: standard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Fetch build version codes accurately for a Play Store track from within
98
+ Fastlane.
99
+ email:
100
+ - nuno@pinge.org
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - LICENSE
106
+ - README.md
107
+ - Rakefile
108
+ - fastlane/Pluginfile
109
+ - lib/fastlane/plugin/google_play_versions.rb
110
+ - lib/fastlane/plugin/google_play_versions/actions/google_play_track_version_code_action.rb
111
+ - lib/fastlane/plugin/google_play_versions/helper/google_play_versions_helper.rb
112
+ - lib/fastlane/plugin/google_play_versions/version.rb
113
+ homepage: https://github.com/pinge/fastlane-plugin-google_play_versions
114
+ licenses:
115
+ - MIT
116
+ metadata:
117
+ homepage_uri: https://github.com/pinge/fastlane-plugin-google_play_versions
118
+ source_code_uri: https://github.com/pinge/fastlane-plugin-google_play_versions
119
+ changelog_uri: https://github.com/pinge/fastlane-plugin-google_play_versions/CHANGELOG.md
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubygems_version: 3.1.6
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Fastlane plugin to fetch build version codes accurately from the Play Store,
139
+ including archived builds
140
+ test_files: []