fastlane-plugin-appforshare 1.2.0 → 1.4.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: 6761c93eb02620c8efd05cdcedb4b4d55476275af8a792865b6da39ce2f8c6a6
4
- data.tar.gz: 6422775c4165461bb5fc75efa2043f53b708412fdd5ee6fe943b6daa8a207140
3
+ metadata.gz: 7b6cb4abe3dbea2ddaad88995a4dc1041454ee27daecc390b77477a0409a2bc8
4
+ data.tar.gz: d3cdeb4f9655c1ae840fdd492be688d5a72f9a1e1e97b129d0bd94ec0b8d980b
5
5
  SHA512:
6
- metadata.gz: ebd32a3b17654348db87bc5ec5ff9f0d80d6e2c1c4d001fbe685aa878be2d266efd809145617a03a066d999f2a06b93d1ff38e5ea5d1535b47de6220fb200cda
7
- data.tar.gz: 134108be2e5522917c9f2cd6d3b43380563f4ea187c2391435284a4e320fe463e072fad89a2b1157e4c764257dcadc0bf4f645da1338249de341f0e9bdbcc0bc
6
+ metadata.gz: e7bb439b87e7eed9f3eff0ed50200bd21bee12906c074f379870c985312776418cac4a4ec9c85c73c014b511c0c9755c616ccbde42c87307155285135920da13
7
+ data.tar.gz: 68c560160bb92ae34949398a0cb8a307bfb43c3973036406a3eec7e1e44318e9764ea1f6e3c26034af443098e67186e3e05bb80ff212736f5f48c0029fa44c7e
data/README.md CHANGED
@@ -26,6 +26,8 @@ the build from gym (`IPA_OUTPUT_PATH`) or gradle (`GRADLE_APK_OUTPUT_PATH`).
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
27
  | `groups` | `APPFORSHARE_GROUPS` | Share the build with these tester groups when it is ready (Team) |
28
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) |
29
31
  | `fail_on` | `APPFORSHARE_FAIL_ON` | `blocked` or `review`: fail the lane on the store readiness check. The build stays uploaded. |
30
32
 
31
33
  Lane context after the action: `APPFORSHARE_URL`, `APPFORSHARE_SLUG`, `APPFORSHARE_READINESS`, and with `channel:`
@@ -17,7 +17,10 @@ module Fastlane
17
17
  UI.user_error!('No build to upload. Pass file: or run gym / gradle first.') unless file && File.exist?(file)
18
18
  client = Helper::AppforshareClient.new(token: params[:api_token], api: params[:api_url], log: ->(m) { UI.message(m) })
19
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]))
20
+ groups: Helper::AppforshareShared.list(params[:groups]), testers: Helper::AppforshareShared.list(params[:testers]),
21
+ emails: Helper::AppforshareShared.list(params[:email]), password: params[:password],
22
+ tags: Helper::AppforshareShared.list(params[:tags]),
23
+ source: params[:git_info] == false ? {} : Helper::AppforshareCiFacts.facts)
21
24
  readiness = 'unknown'
22
25
  findings = []
23
26
  begin
@@ -81,8 +84,12 @@ module Fastlane
81
84
  default_value_dynamic: true),
82
85
  FastlaneCore::ConfigItem.new(key: :release_notes, env_name: 'APPFORSHARE_RELEASE_NOTES', description: 'Release notes shown to testers (Pro and Team)', optional: true),
83
86
  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),
87
+ FastlaneCore::ConfigItem.new(key: :tags, env_name: 'APPFORSHARE_TAGS', description: 'Build tags, up to 10 (qa, ring-pilot); channels that follow a tag take the build (Pro and Team)', optional: true, type: Array),
88
+ FastlaneCore::ConfigItem.new(key: :git_info, env_name: 'APPFORSHARE_GIT_INFO', description: 'Send the commit, branch, git tag and CI run read from the CI variables (Pro and Team keep them)', optional: true, type: Boolean, default_value: true),
84
89
  FastlaneCore::ConfigItem.new(key: :groups, env_name: 'APPFORSHARE_GROUPS', description: 'Share the build with these tester groups when ready (Team)', optional: true, type: Array),
85
90
  FastlaneCore::ConfigItem.new(key: :testers, env_name: 'APPFORSHARE_TESTERS', description: 'Share the build with these tester emails when ready (Team)', optional: true, type: Array),
91
+ 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),
92
+ 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),
86
93
  FastlaneCore::ConfigItem.new(key: :fail_on, env_name: 'APPFORSHARE_FAIL_ON', description: 'Fail the lane when store readiness is "blocked", or "review"', optional: true,
87
94
  verify_block: proc { |v| UI.user_error!('fail_on takes "blocked" or "review"') unless %w[blocked review].include?(v) }),
88
95
  FastlaneCore::ConfigItem.new(key: :api_url, env_name: 'APPFORSHARE_API', description: 'API origin', optional: true, default_value: 'https://appforshare.io')
@@ -0,0 +1,74 @@
1
+ require 'uri'
2
+
3
+ module Fastlane
4
+ module Helper
5
+ # Where the build came from (commit, branch, git tag, CI run, repository, CI build number), read from the variables
6
+ # each CI sets; the same rules as the npm CLI (packages/cli/src/ci-facts.ts). The server cleans every value again
7
+ # (https only, no query or credentials kept), so nothing here needs to be perfect. Pro and Team keep them.
8
+ module AppforshareCiFacts
9
+ module_function
10
+
11
+ def v(env, *names)
12
+ names.each do |n|
13
+ x = env[n].to_s.strip
14
+ return x unless x.empty?
15
+ end
16
+ nil
17
+ end
18
+
19
+ def from_ref(ref)
20
+ return {} if ref.nil?
21
+ return { branch: ref.sub(%r{\Arefs/heads/}, '') } if ref.start_with?('refs/heads/')
22
+ return { tag: ref.sub(%r{\Arefs/tags/}, '') } if ref.start_with?('refs/tags/')
23
+ return {} if ref.start_with?('refs/')
24
+
25
+ { branch: ref }
26
+ end
27
+
28
+ def facts(env = ENV)
29
+ f =
30
+ if env['GITHUB_ACTIONS'] == 'true'
31
+ server = v(env, 'GITHUB_SERVER_URL') || 'https://github.com'
32
+ repo = v(env, 'GITHUB_REPOSITORY')
33
+ tag = env['GITHUB_REF_TYPE'] == 'tag'
34
+ { ciProvider: 'github', commit: v(env, 'GITHUB_SHA'), branch: tag ? nil : v(env, 'GITHUB_HEAD_REF', 'GITHUB_REF_NAME'), tag: tag ? v(env, 'GITHUB_REF_NAME') : nil,
35
+ repoUrl: repo && "#{server}/#{repo}", ciRunUrl: repo && env['GITHUB_RUN_ID'] && "#{server}/#{repo}/actions/runs/#{env['GITHUB_RUN_ID']}", buildNumber: v(env, 'GITHUB_RUN_NUMBER') }
36
+ elsif env['GITLAB_CI'] == 'true'
37
+ { ciProvider: 'gitlab', commit: v(env, 'CI_COMMIT_SHA'), branch: v(env, 'CI_COMMIT_BRANCH', 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'), tag: v(env, 'CI_COMMIT_TAG'),
38
+ repoUrl: v(env, 'CI_PROJECT_URL'), ciRunUrl: v(env, 'CI_PIPELINE_URL', 'CI_JOB_URL'), buildNumber: v(env, 'CI_PIPELINE_IID', 'CI_PIPELINE_ID') }
39
+ elsif env['BITRISE_IO'] == 'true' || v(env, 'BITRISE_BUILD_URL')
40
+ { ciProvider: 'bitrise', commit: v(env, 'GIT_CLONE_COMMIT_HASH', 'BITRISE_GIT_COMMIT'), branch: v(env, 'BITRISE_GIT_BRANCH'), tag: v(env, 'BITRISE_GIT_TAG'),
41
+ repoUrl: v(env, 'GIT_REPOSITORY_URL'), ciRunUrl: v(env, 'BITRISE_BUILD_URL'), buildNumber: v(env, 'BITRISE_BUILD_NUMBER') }
42
+ elsif v(env, 'CM_BUILD_ID')
43
+ app = v(env, 'CM_PROJECT_ID')
44
+ { ciProvider: 'codemagic', commit: v(env, 'CM_COMMIT'), branch: v(env, 'CM_BRANCH'), tag: v(env, 'CM_TAG'),
45
+ ciRunUrl: app && "https://codemagic.io/app/#{app}/build/#{v(env, 'CM_BUILD_ID')}", buildNumber: v(env, 'BUILD_NUMBER') }
46
+ elsif env['CIRCLECI'] == 'true'
47
+ { ciProvider: 'circleci', commit: v(env, 'CIRCLE_SHA1'), branch: v(env, 'CIRCLE_BRANCH'), tag: v(env, 'CIRCLE_TAG'),
48
+ repoUrl: v(env, 'CIRCLE_REPOSITORY_URL'), ciRunUrl: v(env, 'CIRCLE_BUILD_URL'), buildNumber: v(env, 'CIRCLE_BUILD_NUM') }
49
+ elsif env['TF_BUILD'].to_s.downcase == 'true'
50
+ pr = from_ref(v(env, 'SYSTEM_PULLREQUEST_SOURCEBRANCH'))
51
+ ref = from_ref(v(env, 'BUILD_SOURCEBRANCH'))
52
+ coll = v(env, 'SYSTEM_COLLECTIONURI')
53
+ proj = v(env, 'SYSTEM_TEAMPROJECT')
54
+ id = v(env, 'BUILD_BUILDID')
55
+ run = coll && proj && id ? "#{coll.sub(%r{/?\z}, '/')}#{URI.encode_www_form_component(proj).gsub('+', '%20')}/_build/results?buildId=#{id}" : nil
56
+ { ciProvider: 'azure', commit: v(env, 'BUILD_SOURCEVERSION'), branch: pr[:branch] || ref[:branch], tag: ref[:tag],
57
+ repoUrl: v(env, 'BUILD_REPOSITORY_URI'), ciRunUrl: run, buildNumber: v(env, 'BUILD_BUILDNUMBER') }
58
+ elsif v(env, 'BITBUCKET_BUILD_NUMBER')
59
+ full = v(env, 'BITBUCKET_REPO_FULL_NAME')
60
+ { ciProvider: 'bitbucket', commit: v(env, 'BITBUCKET_COMMIT'), branch: v(env, 'BITBUCKET_BRANCH'), tag: v(env, 'BITBUCKET_TAG'),
61
+ repoUrl: full && "https://bitbucket.org/#{full}", ciRunUrl: full && "https://bitbucket.org/#{full}/pipelines/results/#{v(env, 'BITBUCKET_BUILD_NUMBER')}",
62
+ buildNumber: v(env, 'BITBUCKET_BUILD_NUMBER') }
63
+ elsif v(env, 'JENKINS_URL', 'JENKINS_HOME')
64
+ tag = v(env, 'TAG_NAME')
65
+ branch = tag ? nil : (v(env, 'BRANCH_NAME') || v(env, 'GIT_BRANCH')&.sub(%r{\A(?:origin|refs/remotes/origin)/}, ''))
66
+ { ciProvider: 'jenkins', commit: v(env, 'GIT_COMMIT'), branch: branch, tag: tag, repoUrl: v(env, 'GIT_URL'), ciRunUrl: v(env, 'BUILD_URL'), buildNumber: v(env, 'BUILD_NUMBER') }
67
+ else
68
+ {}
69
+ end
70
+ f.reject { |_k, x| x.nil? || x.to_s.empty? }
71
+ end
72
+ end
73
+ end
74
+ end
@@ -14,13 +14,21 @@ module Fastlane
14
14
  @log = log || ->(_msg) {}
15
15
  end
16
16
 
17
- def upload(path, notes: nil, channel: nil, groups: [], testers: [])
17
+ def upload(path, notes: nil, channel: nil, groups: [], testers: [], emails: [], password: nil, tags: [], source: {})
18
18
  size = File.size(path)
19
19
  body = { fileName: File.basename(path), size: size }
20
+ # Commit, branch, git tag, CI run and build tags (Pro and Team keep them; other plans upload without).
21
+ unless source.empty? && tags.empty?
22
+ body.merge!(source)
23
+ body[:tags] = tags unless tags.empty?
24
+ body[:sentBy] = 'fastlane'
25
+ end
20
26
  body[:releaseNotes] = notes[0, 5000] if notes && !notes.empty?
21
27
  body[:channel] = channel if channel && !channel.empty?
22
28
  body[:groups] = groups unless groups.empty?
23
29
  body[:testers] = testers unless testers.empty?
30
+ body[:emails] = emails unless emails.empty?
31
+ body[:password] = password if password && !password.empty?
24
32
  created = request(:post, '/uploads', json: body)
25
33
  @log.call("Uploading #{File.basename(path)} (#{format('%.1f', size / 1024.0 / 1024)} MB)")
26
34
  offset = created['offset'] || 0
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Appforshare
3
- VERSION = '1.2.0'
3
+ VERSION = '1.4.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.2.0
4
+ version: 1.4.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-11-02 00:00:00.000000000 Z
11
+ date: 2026-12-02 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,
@@ -29,6 +29,7 @@ files:
29
29
  - lib/fastlane/plugin/appforshare/actions/appforshare_latest_action.rb
30
30
  - lib/fastlane/plugin/appforshare/actions/appforshare_remove_testers_action.rb
31
31
  - lib/fastlane/plugin/appforshare/actions/appforshare_udids_action.rb
32
+ - lib/fastlane/plugin/appforshare/helper/ci_facts.rb
32
33
  - lib/fastlane/plugin/appforshare/helper/client.rb
33
34
  - lib/fastlane/plugin/appforshare/version.rb
34
35
  homepage: https://appforshare.io/docs/ci