fastlane-plugin-emerge 0.2.1 → 0.3.3

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: 9aff516861f028150b41676dec2e066c71cbacba42ee5703b7f580f2b9882450
4
- data.tar.gz: e16dd75722493adf65d31fe45d3e3a504c71368861d029d15636f14d39a4ee54
3
+ metadata.gz: cc17f46cfc65d4e32951d958932fbbfed3d8c5e535545e65f4b94a3a1810fe3c
4
+ data.tar.gz: 007d7e6bf3ae00ac20eafea8a661bdd634adb37ad130c757ed3ff14db17c18cd
5
5
  SHA512:
6
- metadata.gz: 84c97fec983bf5925e23b6726896faa2de2a1fef1ca36c78669165da1a1044cba9ebf983efdd59963e63791daa65858b492db22efa054f5f6ac84bb8b87be00b
7
- data.tar.gz: 8564d86036ae326e3c5692304a14a4319092b02f7f964ef674ed7970c5bcedaac5aea40b2e3823eb6e0e59f6e6d17b068d7d8718acd580f0fdd8f348ac3ad3ff
6
+ metadata.gz: c273d5faa4ad923ee625b0d132691ed2859a71722ce52ba96750c076b872bb055e31884dec53b12ec7d043750f5d9c7673015b15cef262e0c5a4d4b8ca7390bf
7
+ data.tar.gz: 0a16f5257de169978011cdc472dec9d1f7e3d0af27a419c2b9130a77c2b480b68b03521895edcbb2ae8003835036df1874f53b7f8f7473ed1ac013f140c4f0ab
@@ -37,22 +37,24 @@ module Fastlane
37
37
  FileUtils.mkdir_p application_folder
38
38
  FileUtils.mkdir_p dsym_folder
39
39
  FileUtils.cp_r(file_path, application_folder)
40
- Dir.glob("#{absolute_path.dirname}/*/*.dsym") do |filename|
41
- UI.message("Found dSYM: #{Pathname.new(filename).basename}")
42
- FileUtils.cp_r(filename, dsym_folder)
43
- end
40
+ copy_dsyms("#{absolute_path.dirname}/*.dsym", dsym_folder)
41
+ copy_dsyms("#{absolute_path.dirname}/*/*.dsym", dsym_folder)
44
42
  Xcodeproj::Plist.write_to_path({"NAME" => "Emerge Upload"}, "#{d}/archive.xcarchive/Info.plist")
45
43
  file_path = "#{absolute_path.dirname}/archive.xcarchive.zip"
46
44
  ZipAction.run(
47
45
  path: "#{d}/archive.xcarchive",
48
- output_path: file_path)
46
+ output_path: file_path,
47
+ exclude: [],
48
+ include: [])
49
49
  UI.message("Archive generated at #{file_path}")
50
50
  end
51
51
  elsif File.extname(file_path) == '.xcarchive'
52
52
  zip_path = file_path + ".zip"
53
53
  Actions::ZipAction.run(
54
54
  path: file_path,
55
- output_path: zip_path)
55
+ output_path: zip_path,
56
+ exclude: [],
57
+ include: [])
56
58
  file_path = zip_path
57
59
  elsif !File.extname(file_path) == '.zip'
58
60
  UI.error("Invalid input file")
@@ -102,6 +104,13 @@ module Fastlane
102
104
  end
103
105
  end
104
106
 
107
+ def self.copy_dsyms(from, to)
108
+ Dir.glob(from) do |filename|
109
+ UI.message("Found dSYM: #{Pathname.new(filename).basename}")
110
+ FileUtils.cp_r(filename, to)
111
+ end
112
+ end
113
+
105
114
  def self.description
106
115
  "Fastlane plugin for Emerge"
107
116
  end
@@ -0,0 +1,86 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/print_table'
3
+ require_relative '../helper/emerge_helper'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class EmergeComment < Action
8
+ def self.run(params)
9
+ url = 'https://api.emergetools.com/getComment'
10
+ api_token = params[:api_token]
11
+ gitlab_url = params[:gitlab_url]
12
+ project_id = params[:gitlab_project_id]
13
+ pr_number = params[:pr_number]
14
+ gitlab_access_token = params[:gitlab_access_token]
15
+
16
+ requestParams = {
17
+ buildId: params[:build_id],
18
+ baseBuildId: params[:base_build_id]
19
+ }
20
+ resp = Faraday.get(url, requestParams, {'x-api-token' => api_token})
21
+ case resp.status
22
+ when 200
23
+ UI.message("Received comment from Emerge")
24
+ baseURL = gitlab_url ? gitlab_url : "https://gitlab.com"
25
+ url = "#{baseURL}/api/v4/projects/#{project_id}/merge_requests/#{pr_number}/notes"
26
+ gitlabResponse = Faraday.post(url, {"body" => resp.body}, {'Authorization' => "Bearer #{gitlab_access_token}"})
27
+ case gitlabResponse.status
28
+ when 200...299
29
+ UI.message("Successfully posted comment")
30
+ else
31
+ UI.error("Received error #{gitlabResponse.status} from Gitlab")
32
+ end
33
+ else
34
+ UI.error("Received error #{resp.status} from Emerge")
35
+ end
36
+ end
37
+
38
+ def self.description
39
+ "Post an Emerge PR comment, currently supports Gitlab only."
40
+ end
41
+
42
+ def self.authors
43
+ ["Emerge Tools"]
44
+ end
45
+
46
+ def self.available_options
47
+ [
48
+ FastlaneCore::ConfigItem.new(key: :api_token,
49
+ env_name: "EMERGE_API_TOKEN",
50
+ description: "An API token for Emerge",
51
+ optional: false,
52
+ type: String),
53
+ FastlaneCore::ConfigItem.new(key: :gitlab_acces_token,
54
+ env_name: "GITLAB_ACCESS_TOKEN",
55
+ description: "An access token for Gitlab",
56
+ optional: false,
57
+ type: String),
58
+ FastlaneCore::ConfigItem.new(key: :pr_number,
59
+ description: "The PR number that triggered this upload",
60
+ optional: false,
61
+ type: String),
62
+ FastlaneCore::ConfigItem.new(key: :build_id,
63
+ description: "A string to identify this build",
64
+ optional: false,
65
+ type: String),
66
+ FastlaneCore::ConfigItem.new(key: :base_build_id,
67
+ description: "Id of the build to compare with this upload",
68
+ optional: false,
69
+ type: String),
70
+ FastlaneCore::ConfigItem.new(key: :gitlab_url,
71
+ description: "URL of the self hosted gitlab instance",
72
+ optional: true,
73
+ type: String),
74
+ FastlaneCore::ConfigItem.new(key: :gitlab_project_id,
75
+ description: "Id of the gitlab project this upload was triggered from",
76
+ optional: false,
77
+ type: Integer)
78
+ ]
79
+ end
80
+
81
+ def self.is_supported?(platform)
82
+ platform == :ios
83
+ end
84
+ end
85
+ end
86
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Emerge
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-emerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerge Tools, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +160,7 @@ files:
160
160
  - README.md
161
161
  - lib/fastlane/plugin/emerge.rb
162
162
  - lib/fastlane/plugin/emerge/actions/emerge_action.rb
163
+ - lib/fastlane/plugin/emerge/actions/emerge_comment_action.rb
163
164
  - lib/fastlane/plugin/emerge/helper/emerge_helper.rb
164
165
  - lib/fastlane/plugin/emerge/version.rb
165
166
  homepage: https://github.com/EmergeTools/fastlane-plugin-emerge