Commit 5a495e0f authored by Vadim Vlasov's avatar Vadim Vlasov

feat: add macOS, Windows and WebGL platform support for AppGate upload

parent aeebc047
...@@ -12,13 +12,23 @@ module Fastlane ...@@ -12,13 +12,23 @@ module Fastlane
branch = params[:branch] branch = params[:branch]
include_branch = params[:include_branch] include_branch = params[:include_branch]
skip_waiting_for_release = params[:skip_waiting_for_release] skip_waiting_for_release = params[:skip_waiting_for_release]
version = params[:version]
build_number = params[:build_number]
if !include_branch if !include_branch
branch = "" branch = ""
end end
UI.message("Starting release upload...") UI.message("Starting release upload...")
release_data = Helper::AppGateHelper.create_release(api_key, app_id, branch, File.basename(file_path), File.size(file_path)) release_data = Helper::AppGateHelper.create_release(
api_key,
app_id,
branch,
File.basename(file_path),
File.size(file_path),
version,
build_number
)
UI.abort_with_message!("Failed to create release") unless release_data UI.abort_with_message!("Failed to create release") unless release_data
release_id = release_data[:release_id] release_id = release_data[:release_id]
...@@ -58,7 +68,7 @@ module Fastlane ...@@ -58,7 +68,7 @@ module Fastlane
default_value: ""), default_value: ""),
FastlaneCore::ConfigItem.new(key: :file_path, FastlaneCore::ConfigItem.new(key: :file_path,
env_name: "APPGATE_FILE_PATH", env_name: "APPGATE_FILE_PATH",
description: "Path to your build file (APK or AAB)", description: "Path to your build file (IPA, APK, AAB, DMG, PKG, ZIP, EXE, MSI, MSIX, APPX)",
verify_block: proc do |value| verify_block: proc do |value|
UI.user_error!("Could not find file at path '#{value}'") unless File.exist?(value) UI.user_error!("Could not find file at path '#{value}'") unless File.exist?(value)
end), end),
...@@ -82,7 +92,17 @@ module Fastlane ...@@ -82,7 +92,17 @@ module Fastlane
description: "Skip waiting for release processing", description: "Skip waiting for release processing",
optional: true, optional: true,
is_string: false, is_string: false,
default_value: false) default_value: false),
FastlaneCore::ConfigItem.new(key: :version,
env_name: "APPGATE_VERSION",
description: "Version string (required for Windows, macOS, WebGL platforms where metadata cannot be auto-extracted)",
optional: true,
default_value: nil),
FastlaneCore::ConfigItem.new(key: :build_number,
env_name: "APPGATE_BUILD_NUMBER",
description: "Build number (required for Windows, macOS, WebGL platforms where metadata cannot be auto-extracted)",
optional: true,
default_value: nil)
] ]
end end
...@@ -91,7 +111,7 @@ module Fastlane ...@@ -91,7 +111,7 @@ module Fastlane
end end
def self.is_supported?(platform) def self.is_supported?(platform)
[:ios, :android].include?(platform) [:ios, :android, :mac, :windows].include?(platform)
end end
end end
end end
......
...@@ -20,7 +20,7 @@ module Fastlane ...@@ -20,7 +20,7 @@ module Fastlane
end end
end end
def self.create_release(api_key, app_id, branch, file_name, file_size) def self.create_release(api_key, app_id, branch, file_name, file_size, version = nil, build_number = nil)
url = "#{BASE_URL}/app/#{app_id}/releases" url = "#{BASE_URL}/app/#{app_id}/releases"
body = { body = {
branch: branch, branch: branch,
...@@ -28,6 +28,10 @@ module Fastlane ...@@ -28,6 +28,10 @@ module Fastlane
file_name: file_name file_name: file_name
} }
# Add optional version and build_number for platforms that don't support auto-extraction
body[:version] = version if version && !version.empty?
body[:build_number] = build_number if build_number && !build_number.empty?
response = self.request_with_retry(:post, url, api_key, body) response = self.request_with_retry(:post, url, api_key, body)
return { release_id: response['release_id'], upload_token: response['upload_token'] } if response && response['release_id'] && response['upload_token'] return { release_id: response['release_id'], upload_token: response['upload_token'] } if response && response['release_id'] && response['upload_token']
nil nil
......
module Fastlane module Fastlane
module Furylion module Furylion
VERSION = "1.3.0" VERSION = "1.3.1"
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment