fastlane-plugin-appforshare 1.1.0 → 1.3.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: beddf76a00ee95aee77c292f523d005bb6a37a7e246936222a50496a5392db3c
4
- data.tar.gz: 565985cd9fa6ad4fe0966d35b61be965c89e7a2f9b1d87090fda1b60230cb517
3
+ metadata.gz: 997bd1bba9545b7966145f8a913ddc13d1131af2987435a6c1773a952bc29f17
4
+ data.tar.gz: ed7d5e5f2a57408a234378bfb3134d42c067e995519bbce15d14681b9b7494d3
5
5
  SHA512:
6
- metadata.gz: b1a06c336d21e0b9252bb047862b091fe9e34ae2f1be61c1cdf29c28c2f50f78bb6aec2daf94c546e7dc96cc45e7ff8b438e0a59a3aff335129ec58958e2ddf5
7
- data.tar.gz: 571203cceac457fc55497a87351f3a7ee820babdc9b58b3283c11f0ed02ef9bb6ead1ac9043cd28607d1e7ac3eebbf332bd438cb51a1349e6fc187ea3d22ab6c
6
+ metadata.gz: 5701bff050817b5ebf2aef2459365c464e77c5f30c88ac32594d9a43aff3d474ddc7f104f80cf4e7983f7cc236d175b0d9a13cd16a09014b7e824f3601dac86e
7
+ data.tar.gz: 49842d13f44b27f3e47dcf678445063f880fc2e578b3a60fb9202c22a1e102186dc5c8fc1f046a09eafaa3953b96d2b209ef4801fc25308b7f7d622d0dd06196
data/README.md CHANGED
@@ -24,10 +24,42 @@ the build from gym (`IPA_OUTPUT_PATH`) or gradle (`GRADLE_APK_OUTPUT_PATH`).
24
24
  | `file` | `APPFORSHARE_FILE` | .ipa or .apk |
25
25
  | `release_notes` | `APPFORSHARE_RELEASE_NOTES` | Shown to testers (Pro and Team) |
26
26
  | `channel` | `APPFORSHARE_CHANNEL` | Put the build into a channel (`beta`, `live`), created on first use. Its link always opens the newest build in it (Pro and Team) |
27
+ | `groups` | `APPFORSHARE_GROUPS` | Share the build with these tester groups when it is ready (Team) |
28
+ | `testers` | `APPFORSHARE_TESTERS` | Share the build with these tester emails when it is ready (Team) |
29
+ | `email` | `APPFORSHARE_EMAIL` | Email the install link to up to 5 addresses when it is ready (Pro and Team) |
30
+ | `password` | `APPFORSHARE_PASSWORD` | Protect the install link with a password (4 to 128 characters) |
27
31
  | `fail_on` | `APPFORSHARE_FAIL_ON` | `blocked` or `review`: fail the lane on the store readiness check. The build stays uploaded. |
28
32
 
29
33
  Lane context after the action: `APPFORSHARE_URL`, `APPFORSHARE_SLUG`, `APPFORSHARE_READINESS`, and with `channel:`
30
34
  `APPFORSHARE_CHANNEL_URL`. The store readiness
31
35
  check is guidance about current App Store and Google Play rules, not a promise of approval.
32
36
 
37
+ ## Testers, groups and devices
38
+
39
+ The same jobs as Firebase App Distribution's fastlane actions, with no Google account for your testers.
40
+
41
+ | Action | What it does |
42
+ |---|---|
43
+ | `appforshare_add_testers(emails:, file:, project:, groups:, notify:)` | Add testers, optionally to a project and groups (Team) |
44
+ | `appforshare_remove_testers(emails:, file:, project:)` | Remove testers, or with `project:` only the access you gave them there (Team) |
45
+ | `appforshare_create_group(name:, project:, emails:)` | Make a tester group, optionally on a project and with members (Team) |
46
+ | `appforshare_delete_group(name:)` | Delete a group; its members stay testers (Team) |
47
+ | `appforshare_udids(output_file:)` | Write the UDIDs testers sent to a file in Apple's format (`APPFORSHARE_UDIDS_FILE`) |
48
+ | `appforshare_latest(app:, platform:, channel:)` | Newest build: `APPFORSHARE_LATEST_VERSION`, `APPFORSHARE_LATEST_BUILD_NUMBER`, `APPFORSHARE_LATEST_URL` |
49
+
50
+ ```ruby
51
+ lane :devices do
52
+ appforshare_udids(output_file: "devices.txt")
53
+ register_devices(devices_file: "devices.txt")
54
+ match(type: "adhoc", force_for_new_devices: true)
55
+ end
56
+
57
+ lane :beta_android do
58
+ latest = appforshare_latest(app: "com.example.shop", platform: "android")
59
+ increment_version_code(version_code: latest["versionCode"].to_i + 1)
60
+ gradle(task: "assembleRelease")
61
+ appforshare(groups: "Client QA", testers: "pm@client.com")
62
+ end
63
+ ```
64
+
33
65
  MIT license. Source: https://github.com/appforshare/fastlane-plugin-appforshare
@@ -1,5 +1,6 @@
1
1
  require 'fastlane/action'
2
2
  require_relative '../helper/client'
3
+ require_relative 'appforshare_base'
3
4
 
4
5
  module Fastlane
5
6
  module Actions
@@ -15,7 +16,9 @@ module Fastlane
15
16
  file = params[:file]
16
17
  UI.user_error!('No build to upload. Pass file: or run gym / gradle first.') unless file && File.exist?(file)
17
18
  client = Helper::AppforshareClient.new(token: params[:api_token], api: params[:api_url], log: ->(m) { UI.message(m) })
18
- status = client.upload(file, notes: params[:release_notes], channel: params[:channel])
19
+ status = client.upload(file, notes: params[:release_notes], channel: params[:channel],
20
+ groups: Helper::AppforshareShared.list(params[:groups]), testers: Helper::AppforshareShared.list(params[:testers]),
21
+ emails: Helper::AppforshareShared.list(params[:email]), password: params[:password])
19
22
  readiness = 'unknown'
20
23
  findings = []
21
24
  begin
@@ -79,6 +82,10 @@ module Fastlane
79
82
  default_value_dynamic: true),
80
83
  FastlaneCore::ConfigItem.new(key: :release_notes, env_name: 'APPFORSHARE_RELEASE_NOTES', description: 'Release notes shown to testers (Pro and Team)', optional: true),
81
84
  FastlaneCore::ConfigItem.new(key: :channel, env_name: 'APPFORSHARE_CHANNEL', description: 'Put the build into this channel (Beta, Live), created on first use (Pro and Team)', optional: true),
85
+ FastlaneCore::ConfigItem.new(key: :groups, env_name: 'APPFORSHARE_GROUPS', description: 'Share the build with these tester groups when ready (Team)', optional: true, type: Array),
86
+ FastlaneCore::ConfigItem.new(key: :testers, env_name: 'APPFORSHARE_TESTERS', description: 'Share the build with these tester emails when ready (Team)', optional: true, type: Array),
87
+ FastlaneCore::ConfigItem.new(key: :email, env_name: 'APPFORSHARE_EMAIL', description: 'Email the install link to up to 5 addresses when ready (Pro and Team)', optional: true, type: Array),
88
+ FastlaneCore::ConfigItem.new(key: :password, env_name: 'APPFORSHARE_PASSWORD', description: 'Protect the install link with a password (4 to 128 characters)', optional: true, sensitive: true),
82
89
  FastlaneCore::ConfigItem.new(key: :fail_on, env_name: 'APPFORSHARE_FAIL_ON', description: 'Fail the lane when store readiness is "blocked", or "review"', optional: true,
83
90
  verify_block: proc { |v| UI.user_error!('fail_on takes "blocked" or "review"') unless %w[blocked review].include?(v) }),
84
91
  FastlaneCore::ConfigItem.new(key: :api_url, env_name: 'APPFORSHARE_API', description: 'API origin', optional: true, default_value: 'https://appforshare.io')
@@ -89,6 +96,7 @@ module Fastlane
89
96
  [
90
97
  'appforshare(release_notes: "Fixes the login crash")',
91
98
  'appforshare(channel: "beta")',
99
+ 'appforshare(groups: "Client QA", testers: "pm@client.com")',
92
100
  'appforshare(file: "app/build/outputs/apk/release/app-release.apk", fail_on: "blocked")'
93
101
  ]
94
102
  end
@@ -0,0 +1,50 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class AppforshareAddTestersAction < Action
6
+ def self.run(params)
7
+ s = Helper::AppforshareShared
8
+ emails = s.list(params[:emails], params[:file])
9
+ UI.user_error!('No tester emails. Pass emails: or file:') if emails.empty?
10
+ r = s.client(params).add_testers(emails, project: params[:project], groups: s.list(params[:groups]), notify: params[:notify])
11
+ UI.success("#{r['added']} new tester(s) added, #{r['updated']} already there#{params[:notify] ? '' : ', no invites sent'}.")
12
+ r
13
+ rescue Helper::AppforshareClient::Error => e
14
+ UI.user_error!(e.message)
15
+ end
16
+
17
+ def self.description
18
+ 'Add testers to AppForShare, optionally to a project and tester groups (Team)'
19
+ end
20
+
21
+ def self.authors
22
+ ['AppForShare']
23
+ end
24
+
25
+ def self.return_value
26
+ 'Hash with added and updated counts'
27
+ end
28
+
29
+ def self.available_options
30
+ s = Helper::AppforshareShared
31
+ [s.token_option, *s.emails_options, s.project_option,
32
+ FastlaneCore::ConfigItem.new(key: :groups, env_name: 'APPFORSHARE_GROUPS', description: 'Tester group names, comma separated or an array', optional: true, type: Array),
33
+ FastlaneCore::ConfigItem.new(key: :notify, env_name: 'APPFORSHARE_NOTIFY', description: 'Email new testers an invite', optional: true, type: Boolean, default_value: true),
34
+ s.api_option]
35
+ end
36
+
37
+ def self.example_code
38
+ ['appforshare_add_testers(emails: "sara@example.com, omar@example.com", groups: "Client QA")', 'appforshare_add_testers(file: "testers.txt", project: 12, notify: false)']
39
+ end
40
+
41
+ def self.category
42
+ :beta
43
+ end
44
+
45
+ def self.is_supported?(platform)
46
+ %i[ios android].include?(platform)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,39 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/client'
3
+
4
+ module Fastlane
5
+ module Helper
6
+ # Options and client shared by the tester, group, UDID and latest build actions.
7
+ module AppforshareShared
8
+ def self.client(params)
9
+ Helper::AppforshareClient.new(token: params[:api_token], api: params[:api_url], log: ->(m) { UI.message(m) })
10
+ end
11
+
12
+ # "a@x.com, b@y.com" or an array; a file with one per line or comma separated.
13
+ def self.list(value, file = nil)
14
+ items = Array(value).flat_map { |v| v.to_s.split(/[,\n\r]+/) }
15
+ items += File.read(file).split(/[,\n\r]+/) if file && !file.empty?
16
+ items.map(&:strip).reject(&:empty?)
17
+ end
18
+
19
+ def self.token_option
20
+ FastlaneCore::ConfigItem.new(key: :api_token, env_name: 'APPFORSHARE_TOKEN', description: 'AppForShare API token (Dashboard, Settings)', sensitive: true, optional: false)
21
+ end
22
+
23
+ def self.api_option
24
+ FastlaneCore::ConfigItem.new(key: :api_url, env_name: 'APPFORSHARE_API', description: 'API origin', optional: true, default_value: 'https://appforshare.io')
25
+ end
26
+
27
+ def self.project_option
28
+ FastlaneCore::ConfigItem.new(key: :project, env_name: 'APPFORSHARE_PROJECT', description: 'Project id (appforshare builds --json shows it)', optional: true, type: Integer)
29
+ end
30
+
31
+ def self.emails_options
32
+ [
33
+ FastlaneCore::ConfigItem.new(key: :emails, env_name: 'APPFORSHARE_TESTERS', description: 'Tester emails, comma separated or an array', optional: true, type: Array),
34
+ FastlaneCore::ConfigItem.new(key: :file, env_name: 'APPFORSHARE_TESTERS_FILE', description: 'File with tester emails, one per line or comma separated', optional: true)
35
+ ]
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,55 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class AppforshareCreateGroupAction < Action
6
+ def self.run(params)
7
+ s = Helper::AppforshareShared
8
+ c = s.client(params)
9
+ r = c.create_group(params[:name], project: params[:project])
10
+ UI.success("Group #{r['name']} made.")
11
+ emails = s.list(params[:emails], params[:file])
12
+ unless emails.empty?
13
+ m = c.add_group_members(params[:name], emails, notify: params[:notify])
14
+ UI.success("#{m['group']} now has #{m['members']} member(s).")
15
+ end
16
+ r
17
+ rescue Helper::AppforshareClient::Error => e
18
+ UI.user_error!(e.message)
19
+ end
20
+
21
+ def self.description
22
+ 'Make an AppForShare tester group, optionally on a project and with members (Team)'
23
+ end
24
+
25
+ def self.authors
26
+ ['AppForShare']
27
+ end
28
+
29
+ def self.return_value
30
+ 'Hash with the group id and name'
31
+ end
32
+
33
+ def self.available_options
34
+ s = Helper::AppforshareShared
35
+ [s.token_option,
36
+ FastlaneCore::ConfigItem.new(key: :name, env_name: 'APPFORSHARE_GROUP', description: 'Group name', optional: false),
37
+ s.project_option, *s.emails_options,
38
+ FastlaneCore::ConfigItem.new(key: :notify, env_name: 'APPFORSHARE_NOTIFY', description: 'Invite members who can install something new', optional: true, type: Boolean, default_value: true),
39
+ s.api_option]
40
+ end
41
+
42
+ def self.example_code
43
+ ['appforshare_create_group(name: "Client QA", project: 12, emails: "qa@client.com")']
44
+ end
45
+
46
+ def self.category
47
+ :beta
48
+ end
49
+
50
+ def self.is_supported?(platform)
51
+ %i[ios android].include?(platform)
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,40 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class AppforshareDeleteGroupAction < Action
6
+ def self.run(params)
7
+ r = Helper::AppforshareShared.client(params).delete_group(params[:name])
8
+ UI.success("Group #{r['deleted']} deleted. Its members stay testers.")
9
+ r
10
+ rescue Helper::AppforshareClient::Error => e
11
+ UI.user_error!(e.message)
12
+ end
13
+
14
+ def self.description
15
+ 'Delete an AppForShare tester group; members keep access given to them directly (Team)'
16
+ end
17
+
18
+ def self.authors
19
+ ['AppForShare']
20
+ end
21
+
22
+ def self.available_options
23
+ s = Helper::AppforshareShared
24
+ [s.token_option, FastlaneCore::ConfigItem.new(key: :name, env_name: 'APPFORSHARE_GROUP', description: 'Group name', optional: false), s.api_option]
25
+ end
26
+
27
+ def self.example_code
28
+ ['appforshare_delete_group(name: "Old beta")']
29
+ end
30
+
31
+ def self.category
32
+ :beta
33
+ end
34
+
35
+ def self.is_supported?(platform)
36
+ %i[ios android].include?(platform)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,63 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ module SharedValues
6
+ APPFORSHARE_LATEST_VERSION = :APPFORSHARE_LATEST_VERSION
7
+ APPFORSHARE_LATEST_BUILD_NUMBER = :APPFORSHARE_LATEST_BUILD_NUMBER
8
+ APPFORSHARE_LATEST_URL = :APPFORSHARE_LATEST_URL
9
+ end
10
+
11
+ class AppforshareLatestAction < Action
12
+ def self.run(params)
13
+ b = Helper::AppforshareShared.client(params).latest(platform: params[:platform], app: params[:app], channel: params[:channel])
14
+ Actions.lane_context[SharedValues::APPFORSHARE_LATEST_VERSION] = b['version']
15
+ Actions.lane_context[SharedValues::APPFORSHARE_LATEST_BUILD_NUMBER] = b['versionCode']
16
+ Actions.lane_context[SharedValues::APPFORSHARE_LATEST_URL] = b['url']
17
+ UI.success("Newest build: #{b['name']} #{b['version']} (#{b['versionCode']}) #{b['url']}")
18
+ b
19
+ rescue Helper::AppforshareClient::Error => e
20
+ UI.user_error!(e.message)
21
+ end
22
+
23
+ def self.description
24
+ 'Read the newest AppForShare build (version, build number, install link), for example to bump the build number'
25
+ end
26
+
27
+ def self.authors
28
+ ['AppForShare']
29
+ end
30
+
31
+ def self.return_value
32
+ 'Hash with the build: version, versionCode, url, slug and more'
33
+ end
34
+
35
+ def self.output
36
+ [['APPFORSHARE_LATEST_VERSION', 'Version of the newest build'], ['APPFORSHARE_LATEST_BUILD_NUMBER', 'Its build number'], ['APPFORSHARE_LATEST_URL', 'Its install link']]
37
+ end
38
+
39
+ def self.available_options
40
+ s = Helper::AppforshareShared
41
+ [s.token_option,
42
+ FastlaneCore::ConfigItem.new(key: :platform, env_name: 'APPFORSHARE_PLATFORM', description: 'ios or android', optional: true,
43
+ verify_block: proc { |v| UI.user_error!('platform takes "ios" or "android"') unless %w[ios android].include?(v) }),
44
+ FastlaneCore::ConfigItem.new(key: :app, env_name: 'APPFORSHARE_APP', description: 'Bundle id or package name', optional: true),
45
+ FastlaneCore::ConfigItem.new(key: :channel, env_name: 'APPFORSHARE_CHANNEL', description: 'Only builds in this channel', optional: true),
46
+ s.api_option]
47
+ end
48
+
49
+ def self.example_code
50
+ ['latest = appforshare_latest(app: "com.example.shop", platform: "android")
51
+ increment_version_code(version_code: latest["versionCode"].to_i + 1)']
52
+ end
53
+
54
+ def self.category
55
+ :beta
56
+ end
57
+
58
+ def self.is_supported?(platform)
59
+ %i[ios android].include?(platform)
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,48 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class AppforshareRemoveTestersAction < Action
6
+ def self.run(params)
7
+ s = Helper::AppforshareShared
8
+ emails = s.list(params[:emails], params[:file])
9
+ UI.user_error!('No tester emails. Pass emails: or file:') if emails.empty?
10
+ r = s.client(params).remove_testers(emails, project: params[:project])
11
+ UI.success("#{r['removed']} tester(s) removed#{params[:project] ? ' from the project' : ''}.")
12
+ UI.important("Not testers: #{r['notFound'].join(', ')}") unless (r['notFound'] || []).empty?
13
+ r
14
+ rescue Helper::AppforshareClient::Error => e
15
+ UI.user_error!(e.message)
16
+ end
17
+
18
+ def self.description
19
+ 'Remove testers from AppForShare, or with project: only the access you gave them to that project (Team)'
20
+ end
21
+
22
+ def self.authors
23
+ ['AppForShare']
24
+ end
25
+
26
+ def self.return_value
27
+ 'Hash with removed and notFound'
28
+ end
29
+
30
+ def self.available_options
31
+ s = Helper::AppforshareShared
32
+ [s.token_option, *s.emails_options, s.project_option, s.api_option]
33
+ end
34
+
35
+ def self.example_code
36
+ ['appforshare_remove_testers(emails: "omar@example.com")']
37
+ end
38
+
39
+ def self.category
40
+ :beta
41
+ end
42
+
43
+ def self.is_supported?(platform)
44
+ %i[ios android].include?(platform)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,64 @@
1
+ require_relative 'appforshare_base'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ module SharedValues
6
+ APPFORSHARE_UDIDS_FILE = :APPFORSHARE_UDIDS_FILE
7
+ end
8
+
9
+ class AppforshareUdidsAction < Action
10
+ def self.run(params)
11
+ text = Helper::AppforshareShared.client(params).udids
12
+ File.write(params[:output_file], text)
13
+ count = [text.lines.count - 1, 0].max
14
+ Actions.lane_context[SharedValues::APPFORSHARE_UDIDS_FILE] = params[:output_file]
15
+ UI.success("#{count} device(s) written to #{params[:output_file]}")
16
+ params[:output_file]
17
+ rescue Helper::AppforshareClient::Error => e
18
+ UI.user_error!(e.message)
19
+ end
20
+
21
+ def self.description
22
+ 'Write the UDIDs testers sent to AppForShare to a file in Apple\'s Register Multiple Devices format'
23
+ end
24
+
25
+ def self.details
26
+ 'Pass the file to register_devices(devices_file:) and then match(force_for_new_devices: true), like Firebase\'s get_udids. ' \
27
+ 'AppForShare can also register devices on Apple and remake the profile for you from the Devices page.'
28
+ end
29
+
30
+ def self.authors
31
+ ['AppForShare']
32
+ end
33
+
34
+ def self.return_value
35
+ 'Path of the written file'
36
+ end
37
+
38
+ def self.output
39
+ [['APPFORSHARE_UDIDS_FILE', 'Path of the devices file']]
40
+ end
41
+
42
+ def self.available_options
43
+ s = Helper::AppforshareShared
44
+ [s.token_option,
45
+ FastlaneCore::ConfigItem.new(key: :output_file, env_name: 'APPFORSHARE_UDIDS_FILE', description: 'Where to write the devices file', optional: true, default_value: 'appforshare-devices.txt'),
46
+ s.api_option]
47
+ end
48
+
49
+ def self.example_code
50
+ ['appforshare_udids(output_file: "devices.txt")
51
+ register_devices(devices_file: "devices.txt")
52
+ match(type: "adhoc", force_for_new_devices: true)']
53
+ end
54
+
55
+ def self.category
56
+ :beta
57
+ end
58
+
59
+ def self.is_supported?(platform)
60
+ platform == :ios
61
+ end
62
+ end
63
+ end
64
+ end
@@ -14,11 +14,15 @@ module Fastlane
14
14
  @log = log || ->(_msg) {}
15
15
  end
16
16
 
17
- def upload(path, notes: nil, channel: nil)
17
+ def upload(path, notes: nil, channel: nil, groups: [], testers: [], emails: [], password: nil)
18
18
  size = File.size(path)
19
19
  body = { fileName: File.basename(path), size: size }
20
20
  body[:releaseNotes] = notes[0, 5000] if notes && !notes.empty?
21
21
  body[:channel] = channel if channel && !channel.empty?
22
+ body[:groups] = groups unless groups.empty?
23
+ body[:testers] = testers unless testers.empty?
24
+ body[:emails] = emails unless emails.empty?
25
+ body[:password] = password if password && !password.empty?
22
26
  created = request(:post, '/uploads', json: body)
23
27
  @log.call("Uploading #{File.basename(path)} (#{format('%.1f', size / 1024.0 / 1024)} MB)")
24
28
  offset = created['offset'] || 0
@@ -56,6 +60,54 @@ module Fastlane
56
60
  request(:get, "/ci/builds/#{URI.encode_www_form_component(ref)}")
57
61
  end
58
62
 
63
+ # Newest build, optionally of one platform, app (bundle id or package) or channel.
64
+ def latest(platform: nil, app: nil, channel: nil)
65
+ q = URI.encode_www_form({ platform: platform, app: app, channel: channel }.compact)
66
+ request(:get, "/ci/builds/latest#{q.empty? ? '' : "?#{q}"}")
67
+ end
68
+
69
+ def add_testers(emails, project: nil, groups: [], notify: true)
70
+ request(:post, '/ci/testers', json: { emails: emails, groups: groups, notify: notify }.merge(project ? { project: project } : {}))
71
+ end
72
+
73
+ def remove_testers(emails, project: nil)
74
+ request(:post, '/ci/testers/remove', json: { emails: emails }.merge(project ? { project: project } : {}))
75
+ end
76
+
77
+ def create_group(name, project: nil)
78
+ request(:post, '/ci/tester-groups', json: { name: name }.merge(project ? { project: project } : {}))
79
+ end
80
+
81
+ def delete_group(name)
82
+ request(:delete, "/ci/tester-groups/#{URI.encode_www_form_component(name).gsub('+', '%20')}")
83
+ end
84
+
85
+ def add_group_members(name, emails, notify: true)
86
+ request(:post, "/ci/tester-groups/#{URI.encode_www_form_component(name).gsub('+', '%20')}/members", json: { emails: emails, notify: notify })
87
+ end
88
+
89
+ def distribute(ref, groups: [], testers: [], notify: true)
90
+ request(:post, "/ci/builds/#{URI.encode_www_form_component(ref)}/distribute", json: { groups: groups, testers: testers, notify: notify })
91
+ end
92
+
93
+ # The workspace's iPhone and iPad UDIDs in Apple's "Register Multiple Devices" format.
94
+ def udids
95
+ request_raw(:get, '/ci/devices/apple-devices.txt')
96
+ end
97
+
98
+ def request_raw(method, path)
99
+ uri = URI("#{@api}/api#{path}")
100
+ req = { get: Net::HTTP::Get }[method].new(uri)
101
+ req['Authorization'] = "Bearer #{@token}"
102
+ req['User-Agent'] = "fastlane-plugin-appforshare/#{Fastlane::Appforshare::VERSION}"
103
+ res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https', read_timeout: 60) { |http| http.request(req) }
104
+ unless (200..299).cover?(res.code.to_i)
105
+ data = (JSON.parse(res.body) rescue {})
106
+ raise Error, (data['message'] || "Request failed with #{res.code}")
107
+ end
108
+ res.body.to_s
109
+ end
110
+
59
111
  def request(method, path, json: nil, body: nil, headers: {})
60
112
  uri = URI("#{@api}/api#{path}")
61
113
  attempt = 0
@@ -77,7 +129,9 @@ module Fastlane
77
129
  code = res.code.to_i
78
130
  raise IOError, "HTTP #{code}" if code >= 500 && attempt < 6
79
131
  offset_reply = code == 400 && data['offset'].is_a?(Integer)
80
- unless (200..299).cover?(code) || code == 409 || offset_reply
132
+ # 409 means "already have these bytes" on the resumable upload only; elsewhere it is a real conflict.
133
+ resumed = code == 409 && path.start_with?('/uploads')
134
+ unless (200..299).cover?(code) || resumed || offset_reply
81
135
  msg = data['message'].is_a?(Array) ? data['message'].first : data['message']
82
136
  raise Error, (msg || "Request failed with #{code}")
83
137
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Appforshare
3
- VERSION = '1.1.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-appforshare
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppForShare
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-31 00:00:00.000000000 Z
11
+ date: 2026-11-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fastlane action that uploads an .ipa or .apk to AppForShare (appforshare.io),
14
14
  waits for it to be ready, returns the install link and the store readiness status,
@@ -22,6 +22,13 @@ files:
22
22
  - README.md
23
23
  - lib/fastlane/plugin/appforshare.rb
24
24
  - lib/fastlane/plugin/appforshare/actions/appforshare_action.rb
25
+ - lib/fastlane/plugin/appforshare/actions/appforshare_add_testers_action.rb
26
+ - lib/fastlane/plugin/appforshare/actions/appforshare_base.rb
27
+ - lib/fastlane/plugin/appforshare/actions/appforshare_create_group_action.rb
28
+ - lib/fastlane/plugin/appforshare/actions/appforshare_delete_group_action.rb
29
+ - lib/fastlane/plugin/appforshare/actions/appforshare_latest_action.rb
30
+ - lib/fastlane/plugin/appforshare/actions/appforshare_remove_testers_action.rb
31
+ - lib/fastlane/plugin/appforshare/actions/appforshare_udids_action.rb
25
32
  - lib/fastlane/plugin/appforshare/helper/client.rb
26
33
  - lib/fastlane/plugin/appforshare/version.rb
27
34
  homepage: https://appforshare.io/docs/ci