watchbuild 0.4.0 → 0.5.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 +4 -4
- data/lib/watchbuild/runner.rb +39 -24
- data/lib/watchbuild/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2843da115ef36c055fbca3c1fbc6b4f431d4c666c84d64d4be63a00fa3f69fc6
|
4
|
+
data.tar.gz: 9e2bf7875dcd8b2be76376c54ef5e10945c57b52202e5144b71ffba45816acab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f042e9f7c70d84ce65c83908e70e7ddb8e77659e534fd84d93cbbbd65c6381ef649d962b168a8f9580996ab308a6347ce00df45e25cb81f03beddc51daadf4
|
7
|
+
data.tar.gz: 4957b2130a16625dc8480e6b590f74d5b9b8e6a87d42b02b054fca46fbf80a4d7a2724cee90aaced684d3e67bf82dbe4eaf9ca79987f7d1eb53713b8453f20b2
|
data/lib/watchbuild/runner.rb
CHANGED
@@ -17,8 +17,7 @@ module WatchBuild
|
|
17
17
|
ENV['FASTLANE_ITC_TEAM_NAME'] = WatchBuild.config[:itc_team_name] if WatchBuild.config[:itc_team_name]
|
18
18
|
ENV['SLACK_URL'] = WatchBuild.config[:slack_url]
|
19
19
|
|
20
|
-
Spaceship::
|
21
|
-
Spaceship::Tunes.select_team
|
20
|
+
Spaceship::ConnectAPI.login(WatchBuild.config[:username], nil, use_portal: false, use_tunes: true)
|
22
21
|
UI.message('Successfully logged in')
|
23
22
|
|
24
23
|
start = Time.now
|
@@ -30,22 +29,31 @@ module WatchBuild
|
|
30
29
|
def wait_for_build(start_time)
|
31
30
|
UI.user_error!("Could not find app with app identifier #{WatchBuild.config[:app_identifier]}") unless app
|
32
31
|
|
32
|
+
build = nil
|
33
|
+
showed_info = false
|
34
|
+
|
33
35
|
loop do
|
34
36
|
begin
|
35
|
-
build = find_build
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
when 0..59
|
41
|
-
time_elapsed = Time.at(seconds_elapsed).utc.strftime '%S seconds'
|
42
|
-
when 60..3599
|
43
|
-
time_elapsed = Time.at(seconds_elapsed).utc.strftime '%M:%S minutes'
|
37
|
+
build = find_build(build)
|
38
|
+
|
39
|
+
if build.nil?
|
40
|
+
UI.important("Read more information on why this build isn't showing up yet - https://github.com/fastlane/fastlane/issues/14997") unless showed_info
|
41
|
+
showed_info = true
|
44
42
|
else
|
45
|
-
|
43
|
+
return build if build.processed?
|
44
|
+
|
45
|
+
seconds_elapsed = (Time.now - start_time).to_i.abs
|
46
|
+
case seconds_elapsed
|
47
|
+
when 0..59
|
48
|
+
time_elapsed = Time.at(seconds_elapsed).utc.strftime '%S seconds'
|
49
|
+
when 60..3599
|
50
|
+
time_elapsed = Time.at(seconds_elapsed).utc.strftime '%M:%S minutes'
|
51
|
+
else
|
52
|
+
time_elapsed = Time.at(seconds_elapsed).utc.strftime '%H:%M:%S hours'
|
53
|
+
end
|
54
|
+
|
55
|
+
UI.message("Waiting #{time_elapsed} for App Store Connect to process the build #{build.app_version} (#{build.version})... this might take a while...")
|
46
56
|
end
|
47
|
-
|
48
|
-
UI.message("Waiting #{time_elapsed} for App Store Connect to process the build #{build.train_version} (#{build.build_version})... this might take a while...")
|
49
57
|
rescue => ex
|
50
58
|
UI.error(ex)
|
51
59
|
UI.message('Something failed... trying again to recover')
|
@@ -65,7 +73,9 @@ module WatchBuild
|
|
65
73
|
return
|
66
74
|
end
|
67
75
|
|
68
|
-
|
76
|
+
platform = build.pre_release_version.platform.downcase.gsub('_', '')
|
77
|
+
|
78
|
+
url = "https://appstoreconnect.apple.com/apps/#{app.id}/testflight/#{platform}/#{build.id}/metadata"
|
69
79
|
|
70
80
|
slack_url = ENV['SLACK_URL'].to_s
|
71
81
|
if !slack_url.empty?
|
@@ -85,7 +95,7 @@ module WatchBuild
|
|
85
95
|
private
|
86
96
|
|
87
97
|
def app
|
88
|
-
@app ||= Spaceship::
|
98
|
+
@app ||= Spaceship::ConnectAPI::App.find(WatchBuild.config[:app_identifier])
|
89
99
|
end
|
90
100
|
|
91
101
|
def notify_slack(build, minutes, url)
|
@@ -93,7 +103,7 @@ module WatchBuild
|
|
93
103
|
require 'uri'
|
94
104
|
require 'json'
|
95
105
|
|
96
|
-
message = "App Store build #{build.
|
106
|
+
message = "App Store build #{build.app_version} (#{build.version}) has finished processing in #{minutes} minutes"
|
97
107
|
slack_url = URI.parse(url)
|
98
108
|
slack_message = {
|
99
109
|
"text": message
|
@@ -118,19 +128,24 @@ module WatchBuild
|
|
118
128
|
require 'terminal-notifier'
|
119
129
|
|
120
130
|
TerminalNotifier.notify('Build finished processing',
|
121
|
-
title:
|
122
|
-
subtitle: "#{build.
|
131
|
+
title: app.name,
|
132
|
+
subtitle: "#{build.app_version} (#{build.version})",
|
123
133
|
execute: "open '#{url}'")
|
124
134
|
end
|
125
135
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
136
|
+
# Finds a build if none given
|
137
|
+
# Otherwise fetches a build (to get updated state)
|
138
|
+
def find_build(build)
|
139
|
+
if build.nil?
|
140
|
+
build = app.get_builds(includes: Spaceship::ConnectAPI::Build::ESSENTIAL_INCLUDES).select do |build|
|
141
|
+
build.processing_state == Spaceship::ConnectAPI::Build::ProcessingState::PROCESSING
|
142
|
+
end.sort_by(&:uploaded_date).last
|
143
|
+
else
|
144
|
+
build = Spaceship::ConnectAPI::Build.get(build_id: build.id, includes: Spaceship::ConnectAPI::Build::ESSENTIAL_INCLUDES)
|
130
145
|
end
|
131
146
|
|
132
147
|
unless build
|
133
|
-
UI.
|
148
|
+
UI.error("No processing builds available for app #{WatchBuild.config[:app_identifier]} - this may take a few minutes (check your email for processing issues if this continues)")
|
134
149
|
end
|
135
150
|
|
136
151
|
build
|
data/lib/watchbuild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watchbuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane
|
@@ -204,8 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
|
208
|
-
rubygems_version: 2.7.6.2
|
207
|
+
rubygems_version: 3.1.4
|
209
208
|
signing_key:
|
210
209
|
specification_version: 4
|
211
210
|
summary: Get a notification once your App Store Connect build is finished processing
|