fastlane-plugin-upload_symbols_to_hockey 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +44 -0
- data/lib/fastlane/plugin/upload_symbols_to_hockey.rb +16 -0
- data/lib/fastlane/plugin/upload_symbols_to_hockey/actions/upload_symbols_to_hockey_action.rb +100 -0
- data/lib/fastlane/plugin/upload_symbols_to_hockey/helper/upload_symbols_to_hockey_helper.rb +12 -0
- data/lib/fastlane/plugin/upload_symbols_to_hockey/version.rb +5 -0
- metadata +175 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb86eae720eafdf9ee59373abc798065c8e1a437
|
4
|
+
data.tar.gz: bebae5c5a0343e883ea75c267becf08435a31da5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: df75e78f7bcdee7ddf0959143a52e2359a0adfcca62450c88b66318cbb2b177137284a7bd42e829b1d44c34eb4f4e1757e02293e2a547ef367eefe978eaaa4c2
|
7
|
+
data.tar.gz: 34807a3cd3586a57a3d0f06a8e63754bc300914988db460c745eeea045f909216af8921ffe8d7aa664aa82d10224d8a30e6a18bd5d9874590d5c1ca0b8138cd7
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Justin Williams <justinw@me.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# upload_symbols_to_hockey plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-upload_symbols_to_hockey)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-upload_symbols_to_hockey`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin upload_symbols_to_hockey
|
11
|
+
```
|
12
|
+
|
13
|
+
## About upload_symbols_to_hockey
|
14
|
+
|
15
|
+
This Fastlane plugin will upload a dSYM dSYM symbolication file to Hockey for the build number you specify.
|
16
|
+
|
17
|
+
## Run tests for this plugin
|
18
|
+
|
19
|
+
To run both the tests, and code style validation, run
|
20
|
+
|
21
|
+
````
|
22
|
+
rake
|
23
|
+
```
|
24
|
+
|
25
|
+
To automatically fix many of the styling issues, use
|
26
|
+
```
|
27
|
+
rubocop -a
|
28
|
+
```
|
29
|
+
|
30
|
+
## Issues and Feedback
|
31
|
+
|
32
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
33
|
+
|
34
|
+
## Troubleshooting
|
35
|
+
|
36
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
|
37
|
+
|
38
|
+
## Using `fastlane` Plugins
|
39
|
+
|
40
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
|
41
|
+
|
42
|
+
## About `fastlane`
|
43
|
+
|
44
|
+
`fastlane` is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/upload_symbols_to_hockey/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module UploadSymbolsToHockey
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::UploadSymbolsToHockey.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Fastlane
|
6
|
+
module Actions
|
7
|
+
class UploadSymbolsToHockeyAction < Action
|
8
|
+
HOST_NAME = 'https://rink.hockeyapp.net'
|
9
|
+
|
10
|
+
def self.run(params)
|
11
|
+
api_token = params[:api_token]
|
12
|
+
build_number = params[:build_number]
|
13
|
+
public_identifier = params[:public_identifier]
|
14
|
+
dsym_path = params[:dsym].shellescape
|
15
|
+
|
16
|
+
conn = Faraday.new(:url => HOST_NAME) do |faraday|
|
17
|
+
faraday.request :multipart
|
18
|
+
faraday.request :url_encoded # form-encode POST params
|
19
|
+
faraday.response :logger # log requests to STDOUT
|
20
|
+
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
21
|
+
faraday.headers['X-HockeyAppToken'] = api_token
|
22
|
+
end
|
23
|
+
|
24
|
+
versions = conn.get do |req|
|
25
|
+
req.url("/api/2/apps/#{public_identifier}/app_versions/")
|
26
|
+
end
|
27
|
+
|
28
|
+
versions_json = JSON.parse(versions.body)
|
29
|
+
versions_json['app_versions'].each do |version|
|
30
|
+
if version['version'] == build_number
|
31
|
+
@version_id = version['id'].to_s
|
32
|
+
break
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
response = conn.put do |req|
|
37
|
+
req.url "/api/2/apps/#{public_identifier}/app_versions/#{@version_id}"
|
38
|
+
req.body = { :file => Faraday::UploadIO.new(dsym_path, 'application/octet-stream') }
|
39
|
+
end
|
40
|
+
|
41
|
+
if response.status == 201
|
42
|
+
UI.success '🏒 dSYM is successfully uploaded to Hockey 🏒'
|
43
|
+
else
|
44
|
+
UI.error "Something went wrong duricng Hockey dSYM upload. Status code is #{response.status}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.description
|
49
|
+
"Upload dSYM symbolication files to Hockey"
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.authors
|
53
|
+
["Justin Williams"]
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.available_options
|
57
|
+
[
|
58
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
59
|
+
env_name: "UPLOAD_SYMBOLS_TO_HOCKEY_API_TOKEN",
|
60
|
+
description: "API Token for Hockey Access",
|
61
|
+
optional: false,
|
62
|
+
type: String,
|
63
|
+
verify_block: proc do |value|
|
64
|
+
UI.user_error!("No API token for Hockey given, pass using `api_token: 'token'`") if value.to_s.length == 0
|
65
|
+
end),
|
66
|
+
|
67
|
+
FastlaneCore::ConfigItem.new(key: :public_identifier,
|
68
|
+
env_name: "UPLOAD_SYMBOLS_TO_HOCKEY_PUBLIC_IDENTIFIER",
|
69
|
+
description: "Public identifier of the app you are targeting",
|
70
|
+
optional: false,
|
71
|
+
type: String,
|
72
|
+
verify_block: proc do |value|
|
73
|
+
UI.user_error!("No public identifier for Hockey given, pass using `public_identifier: 'public_identifier'`") if value.to_s.length == 0
|
74
|
+
end),
|
75
|
+
|
76
|
+
FastlaneCore::ConfigItem.new(key: :dsym,
|
77
|
+
env_name: "UPLOAD_SYMBOLS_TO_HOCKEY_DSYM",
|
78
|
+
description: "Path to your symbols file",
|
79
|
+
optional: false,
|
80
|
+
type: String,
|
81
|
+
default_value: ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] || (Dir["./**/*.dSYM"] + Dir["./**/*.dSYM.zip"]).first,
|
82
|
+
verify_block: proc do |value|
|
83
|
+
UI.user_error!("Couldn't find file at path '#{File.expand_path(value)}'") unless File.exist?(value)
|
84
|
+
UI.user_error!("Symbolication file needs to be dSYM or zip") unless value.end_with?(".zip", ".dSYM")
|
85
|
+
end),
|
86
|
+
|
87
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
88
|
+
env_name: "UPLOAD_SYMBOLS_TO_HOCKEY_BUILD_NUMBER",
|
89
|
+
description: "The build number for the dSYMs you want to upload",
|
90
|
+
optional: false,
|
91
|
+
type: String)
|
92
|
+
]
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.is_supported?(platform)
|
96
|
+
[:ios, :tvos, :osx, :watchos].include?(platform)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class UploadSymbolsToHockeyHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::UploadSymbolsToHockeyHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the upload_symbols_to_hockey plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-upload_symbols_to_hockey
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Williams
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fastlane
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.97.2
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.97.2
|
139
|
+
description:
|
140
|
+
email: justinw@me.com
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- LICENSE
|
146
|
+
- README.md
|
147
|
+
- lib/fastlane/plugin/upload_symbols_to_hockey.rb
|
148
|
+
- lib/fastlane/plugin/upload_symbols_to_hockey/actions/upload_symbols_to_hockey_action.rb
|
149
|
+
- lib/fastlane/plugin/upload_symbols_to_hockey/helper/upload_symbols_to_hockey_helper.rb
|
150
|
+
- lib/fastlane/plugin/upload_symbols_to_hockey/version.rb
|
151
|
+
homepage:
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.5.1
|
172
|
+
signing_key:
|
173
|
+
specification_version: 4
|
174
|
+
summary: Upload dSYM symbolication files to Hockey
|
175
|
+
test_files: []
|