fastlane-plugin-appforshare 1.3.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: 997bd1bba9545b7966145f8a913ddc13d1131af2987435a6c1773a952bc29f17
4
- data.tar.gz: ed7d5e5f2a57408a234378bfb3134d42c067e995519bbce15d14681b9b7494d3
3
+ metadata.gz: 7b6cb4abe3dbea2ddaad88995a4dc1041454ee27daecc390b77477a0409a2bc8
4
+ data.tar.gz: d3cdeb4f9655c1ae840fdd492be688d5a72f9a1e1e97b129d0bd94ec0b8d980b
5
5
  SHA512:
6
- metadata.gz: 5701bff050817b5ebf2aef2459365c464e77c5f30c88ac32594d9a43aff3d474ddc7f104f80cf4e7983f7cc236d175b0d9a13cd16a09014b7e824f3601dac86e
7
- data.tar.gz: 49842d13f44b27f3e47dcf678445063f880fc2e578b3a60fb9202c22a1e102186dc5c8fc1f046a09eafaa3953b96d2b209ef4801fc25308b7f7d622d0dd06196
6
+ metadata.gz: e7bb439b87e7eed9f3eff0ed50200bd21bee12906c074f379870c985312776418cac4a4ec9c85c73c014b511c0c9755c616ccbde42c87307155285135920da13
7
+ data.tar.gz: 68c560160bb92ae34949398a0cb8a307bfb43c3973036406a3eec7e1e44318e9764ea1f6e3c26034af443098e67186e3e05bb80ff212736f5f48c0029fa44c7e
@@ -18,7 +18,9 @@ module Fastlane
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
20
  groups: Helper::AppforshareShared.list(params[:groups]), testers: Helper::AppforshareShared.list(params[:testers]),
21
- emails: Helper::AppforshareShared.list(params[:email]), password: params[:password])
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)
22
24
  readiness = 'unknown'
23
25
  findings = []
24
26
  begin
@@ -82,6 +84,8 @@ module Fastlane
82
84
  default_value_dynamic: true),
83
85
  FastlaneCore::ConfigItem.new(key: :release_notes, env_name: 'APPFORSHARE_RELEASE_NOTES', description: 'Release notes shown to testers (Pro and Team)', optional: true),
84
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),
85
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),
86
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),
87
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),
@@ -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,9 +14,15 @@ module Fastlane
14
14
  @log = log || ->(_msg) {}
15
15
  end
16
16
 
17
- def upload(path, notes: nil, channel: nil, groups: [], testers: [], emails: [], password: nil)
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?
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Appforshare
3
- VERSION = '1.3.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.3.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-03 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