hard_cider 0.1.0 → 0.2.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/.github/workflows/lint.yml +23 -0
- data/.github/workflows/test.yml +32 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +16 -0
- data/.ruby-version +1 -0
- data/.yamllint +5 -0
- data/CODE_OF_CONDUCT.md +77 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +26 -4
- data/README.md +11 -6
- data/bin/console +2 -10
- data/bin/setup +1 -2
- data/exe/hard_cider +6 -0
- data/hard_cider.gemspec +6 -5
- data/lib/hard_cider.rb +36 -0
- data/lib/hard_cider/cli.rb +91 -0
- data/lib/hard_cider/client.rb +52 -7
- data/lib/hard_cider/utils.rb +17 -0
- data/lib/hard_cider/version.rb +1 -1
- metadata +67 -19
- data/.github/test.yml +0 -31
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a497f2aad3430f95f3445dadc8767927db8b3571f0815a634f0d395be7bc3d0
|
|
4
|
+
data.tar.gz: f5719ef1b777bc327a8ac2c8cff6d9731c2a5a735b51c82fd69463fc5970b257
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72cf28d4f0fab7ae0ae884c0cea2d087f3bb204ff8a2b1b1bc4e1281c38fb3d80c83789b9b532b7d724da373097a50f649f8ee5b0bb0b0863a461580a29681bd
|
|
7
|
+
data.tar.gz: baa140fbc11630f60487ebcc524629625bed8cf64c79563e98e1a5bfc168e93d2be5c06e0ec3420dd79f3b93a24a25130afb0d9204ee73001ee233cbd8fdcd3c
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Lint
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Rubocop
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@master
|
|
14
|
+
- name: Set up Ruby 2.6
|
|
15
|
+
uses: actions/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: 2.6.x
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: |
|
|
20
|
+
gem install bundler
|
|
21
|
+
bundle install --jobs=3 --retry=3
|
|
22
|
+
- name: Run rubocop
|
|
23
|
+
run: bundle exec rubocop -P -fq
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: 0 2 * * 1-5
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
rspec:
|
|
11
|
+
name: RSpec
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@master
|
|
16
|
+
- name: Set up Ruby 2.6
|
|
17
|
+
uses: actions/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: 2.6.x
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: |
|
|
22
|
+
gem install bundler
|
|
23
|
+
bundle install --jobs=3 --retry=3
|
|
24
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
25
|
+
chmod +x ./cc-test-reporter
|
|
26
|
+
./cc-test-reporter before-build
|
|
27
|
+
- name: Run rspec
|
|
28
|
+
run: |
|
|
29
|
+
GLI_DEBUG=true bundle exec rspec
|
|
30
|
+
./cc-test-reporter after-build --exit-code $? -t simplecov
|
|
31
|
+
env:
|
|
32
|
+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -8,3 +8,19 @@
|
|
|
8
8
|
# where the inspected file is and continue its way up to the root directory.
|
|
9
9
|
#
|
|
10
10
|
# See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
|
|
11
|
+
#
|
|
12
|
+
---
|
|
13
|
+
Metrics/MethodLength:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
Metrics/BlockLength:
|
|
17
|
+
Enabled: false
|
|
18
|
+
|
|
19
|
+
Style/Documentation:
|
|
20
|
+
Enabled: false
|
|
21
|
+
|
|
22
|
+
Layout/LineLength:
|
|
23
|
+
Enabled: false
|
|
24
|
+
|
|
25
|
+
Metrics/ClassLength:
|
|
26
|
+
Enabled: false
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.6.5
|
data/.yamllint
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at kyle.decot@icloud.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
|
+
|
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
|
74
|
+
|
|
75
|
+
For answers to common questions about this code of conduct, see
|
|
76
|
+
https://www.contributor-covenant.org/faq
|
|
77
|
+
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -2,7 +2,8 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
hard_cider (0.1.0)
|
|
5
|
-
app_store_connect
|
|
5
|
+
app_store_connect (= 0.19.0)
|
|
6
|
+
gli (~> 2.19.0)
|
|
6
7
|
|
|
7
8
|
GEM
|
|
8
9
|
remote: https://rubygems.org/
|
|
@@ -13,6 +14,8 @@ GEM
|
|
|
13
14
|
minitest (~> 5.1)
|
|
14
15
|
tzinfo (~> 1.1)
|
|
15
16
|
zeitwerk (~> 2.2)
|
|
17
|
+
addressable (2.7.0)
|
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
16
19
|
app_store_connect (0.19.0)
|
|
17
20
|
activesupport
|
|
18
21
|
jwt (>= 1.4, <= 2.2.1)
|
|
@@ -20,10 +23,16 @@ GEM
|
|
|
20
23
|
ast (2.4.0)
|
|
21
24
|
coderay (1.1.2)
|
|
22
25
|
concurrent-ruby (1.1.6)
|
|
26
|
+
crack (0.4.3)
|
|
27
|
+
safe_yaml (~> 1.0.0)
|
|
23
28
|
diff-lcs (1.3)
|
|
29
|
+
docile (1.3.2)
|
|
30
|
+
gli (2.19.0)
|
|
31
|
+
hashdiff (1.0.0)
|
|
24
32
|
i18n (1.8.2)
|
|
25
33
|
concurrent-ruby (~> 1.0)
|
|
26
34
|
jaro_winkler (1.5.4)
|
|
35
|
+
json (2.3.0)
|
|
27
36
|
jwt (2.2.1)
|
|
28
37
|
method_source (0.9.2)
|
|
29
38
|
minitest (5.14.0)
|
|
@@ -34,6 +43,7 @@ GEM
|
|
|
34
43
|
pry (0.12.2)
|
|
35
44
|
coderay (~> 1.1.0)
|
|
36
45
|
method_source (~> 0.9.0)
|
|
46
|
+
public_suffix (4.0.3)
|
|
37
47
|
rainbow (3.0.0)
|
|
38
48
|
rake (10.5.0)
|
|
39
49
|
rspec (3.9.0)
|
|
@@ -57,10 +67,20 @@ GEM
|
|
|
57
67
|
ruby-progressbar (~> 1.7)
|
|
58
68
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
59
69
|
ruby-progressbar (1.10.1)
|
|
70
|
+
safe_yaml (1.0.5)
|
|
71
|
+
simplecov (0.16.1)
|
|
72
|
+
docile (~> 1.1)
|
|
73
|
+
json (>= 1.8, < 3)
|
|
74
|
+
simplecov-html (~> 0.10.0)
|
|
75
|
+
simplecov-html (0.10.2)
|
|
60
76
|
thread_safe (0.3.6)
|
|
61
77
|
tzinfo (1.2.6)
|
|
62
78
|
thread_safe (~> 0.1)
|
|
63
79
|
unicode-display_width (1.6.1)
|
|
80
|
+
webmock (3.6.2)
|
|
81
|
+
addressable (>= 2.3.6)
|
|
82
|
+
crack (>= 0.3.2)
|
|
83
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
64
84
|
zeitwerk (2.2.2)
|
|
65
85
|
|
|
66
86
|
PLATFORMS
|
|
@@ -69,10 +89,12 @@ PLATFORMS
|
|
|
69
89
|
DEPENDENCIES
|
|
70
90
|
bundler (~> 2.0)
|
|
71
91
|
hard_cider!
|
|
72
|
-
pry
|
|
92
|
+
pry (~> 0.12.2)
|
|
73
93
|
rake (~> 10.0)
|
|
74
94
|
rspec (~> 3.0)
|
|
75
|
-
rubocop
|
|
95
|
+
rubocop (~> 0.79.0)
|
|
96
|
+
simplecov (~> 0.16.1)
|
|
97
|
+
webmock (~> 3.6.0)
|
|
76
98
|
|
|
77
99
|
BUNDLED WITH
|
|
78
|
-
2.0.
|
|
100
|
+
2.0.2
|
data/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `hard_cider`
|
|
2
|
+
[](https://github.com/kyledecot/hard_cider/actions) [](https://badge.fury.io/rb/hard_cider) [](https://codeclimate.com/github/kyledecot/hard_cider/maintainability) [](https://codeclimate.com/github/kyledecot/hard_cider/test_coverage)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
4
|
+
Wait for your Apple .ipa files to be processed
|
|
6
5
|
|
|
7
6
|
## Installation
|
|
8
7
|
|
|
@@ -22,7 +21,13 @@ Or install it yourself as:
|
|
|
22
21
|
|
|
23
22
|
## Usage
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
```
|
|
25
|
+
hard_cider wait \
|
|
26
|
+
--bundle-id="com.kyledecot.Example" \
|
|
27
|
+
--key-id="KEY_ID" \
|
|
28
|
+
--private-key="$(cat PRIVATE_KEY)" \
|
|
29
|
+
--issuer-id="ISSUER_ID"
|
|
30
|
+
```
|
|
26
31
|
|
|
27
32
|
## Development
|
|
28
33
|
|
|
@@ -32,7 +37,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
37
|
|
|
33
38
|
## Contributing
|
|
34
39
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kyledecot/hard_cider.
|
|
36
41
|
|
|
37
42
|
## License
|
|
38
43
|
|
data/bin/console
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
require 'bundler/setup'
|
|
5
4
|
require 'hard_cider'
|
|
5
|
+
require 'pry'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require 'irb'
|
|
15
|
-
IRB.start(__FILE__)
|
|
7
|
+
Pry.start(HardCider)
|
data/bin/setup
CHANGED
data/exe/hard_cider
ADDED
data/hard_cider.gemspec
CHANGED
|
@@ -15,8 +15,6 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.homepage = 'https://github.com/kyledecot/hard_cider'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
17
|
|
|
18
|
-
# Specify which files should be added to the gem when it is released.
|
|
19
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
20
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
21
19
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
22
20
|
end
|
|
@@ -25,10 +23,13 @@ Gem::Specification.new do |spec|
|
|
|
25
23
|
spec.require_paths = ['lib']
|
|
26
24
|
|
|
27
25
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
28
|
-
spec.add_development_dependency 'pry'
|
|
26
|
+
spec.add_development_dependency 'pry', '~> 0.12.2'
|
|
29
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
30
28
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
31
|
-
spec.add_development_dependency 'rubocop'
|
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0.79.0'
|
|
30
|
+
spec.add_development_dependency 'simplecov', '~> 0.16.1'
|
|
31
|
+
spec.add_development_dependency 'webmock', '~> 3.6.0'
|
|
32
32
|
|
|
33
|
-
spec.add_runtime_dependency 'app_store_connect'
|
|
33
|
+
spec.add_runtime_dependency 'app_store_connect', '0.19.0'
|
|
34
|
+
spec.add_runtime_dependency 'gli', '~> 2.19.0'
|
|
34
35
|
end
|
data/lib/hard_cider.rb
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
require 'hard_cider/version'
|
|
4
4
|
require 'hard_cider/client'
|
|
5
|
+
require 'hard_cider/utils'
|
|
5
6
|
|
|
6
7
|
module HardCider
|
|
8
|
+
CLIENT_OPTIONS = %i[key_id issuer_id private_key].freeze
|
|
9
|
+
private_constant :CLIENT_OPTIONS
|
|
10
|
+
|
|
11
|
+
DEFAULTS = { frequency: 30, timeout: 3600 }.freeze
|
|
12
|
+
|
|
13
|
+
# @param bundle_id [String]
|
|
14
|
+
# @param options [Hash]
|
|
15
|
+
# @return [Boolean]
|
|
16
|
+
def self.wait(bundle_id:, **options)
|
|
17
|
+
options = DEFAULTS.merge(options)
|
|
18
|
+
client = HardCider::Client.new(
|
|
19
|
+
options.slice(*CLIENT_OPTIONS)
|
|
20
|
+
)
|
|
21
|
+
timeout_at = Time.now + options[:timeout]
|
|
22
|
+
|
|
23
|
+
loop do
|
|
24
|
+
options[:before_wait]&.call
|
|
25
|
+
|
|
26
|
+
return true if client.latest_build_processed?(bundle_id)
|
|
27
|
+
return false if Time.now > timeout_at
|
|
28
|
+
|
|
29
|
+
sleep(options[:frequency])
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# @param bundle_id [String]
|
|
34
|
+
# @param options [Hash]
|
|
35
|
+
# @return [String]
|
|
36
|
+
def self.state(bundle_id:, **options)
|
|
37
|
+
client = HardCider::Client.new(
|
|
38
|
+
options.slice(*CLIENT_OPTIONS)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
client.latest_build(bundle_id).dig(:attributes, :processing_state)
|
|
42
|
+
end
|
|
7
43
|
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'hard_cider'
|
|
4
|
+
require 'gli'
|
|
5
|
+
|
|
6
|
+
module HardCider
|
|
7
|
+
class CLI
|
|
8
|
+
extend GLI::App
|
|
9
|
+
|
|
10
|
+
class IPANotProcessed < GLI::CustomExit
|
|
11
|
+
def initialize
|
|
12
|
+
super('IPA Not Processed', 1)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
command :state do |c|
|
|
17
|
+
c.flag %i[i issuer-id],
|
|
18
|
+
desc: 'App Store Connect API Issuer ID',
|
|
19
|
+
mask: true,
|
|
20
|
+
default_value: ENV['APP_STORE_CONNECT_ISSUER_ID']
|
|
21
|
+
|
|
22
|
+
c.flag %i[k key-id],
|
|
23
|
+
desc: 'App Store Connect API Key ID',
|
|
24
|
+
mask: true,
|
|
25
|
+
default_value: ENV['APP_STORE_CONNECT_KEY_ID']
|
|
26
|
+
|
|
27
|
+
c.flag %i[p private-key],
|
|
28
|
+
desc: 'App Store Connect API Private Key',
|
|
29
|
+
mask: true,
|
|
30
|
+
default_value: ENV['APP_STORE_CONNECT_PRIVATE_KEY']
|
|
31
|
+
|
|
32
|
+
c.flag %i[b bundle-id],
|
|
33
|
+
required: true
|
|
34
|
+
|
|
35
|
+
c.flag %i[f frequency],
|
|
36
|
+
desc: 'Frequency',
|
|
37
|
+
type: Integer,
|
|
38
|
+
default_value: HardCider::DEFAULTS[:frequency]
|
|
39
|
+
|
|
40
|
+
c.flag %i[t timeout],
|
|
41
|
+
desc: 'Timeout',
|
|
42
|
+
type: Integer,
|
|
43
|
+
default_value: HardCider::DEFAULTS[:timeout]
|
|
44
|
+
c.action do |_global_options, options, _args|
|
|
45
|
+
puts HardCider.state(Utils.underscore_keys(options))
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
program_desc 'Wait for Apple IPAs'
|
|
50
|
+
|
|
51
|
+
desc 'Wait for Apple IPAs'
|
|
52
|
+
command :wait do |c|
|
|
53
|
+
c.flag %i[i issuer-id],
|
|
54
|
+
desc: 'App Store Connect API Issuer ID',
|
|
55
|
+
mask: true,
|
|
56
|
+
default_value: ENV['APP_STORE_CONNECT_ISSUER_ID']
|
|
57
|
+
|
|
58
|
+
c.flag %i[k key-id],
|
|
59
|
+
desc: 'App Store Connect API Key ID',
|
|
60
|
+
mask: true,
|
|
61
|
+
default_value: ENV['APP_STORE_CONNECT_KEY_ID']
|
|
62
|
+
|
|
63
|
+
c.flag %i[p private-key],
|
|
64
|
+
desc: 'App Store Connect API Private Key',
|
|
65
|
+
mask: true,
|
|
66
|
+
default_value: ENV['APP_STORE_CONNECT_PRIVATE_KEY']
|
|
67
|
+
|
|
68
|
+
c.flag %i[b bundle-id],
|
|
69
|
+
required: true
|
|
70
|
+
|
|
71
|
+
c.flag %i[f frequency],
|
|
72
|
+
desc: 'Frequency',
|
|
73
|
+
type: Integer,
|
|
74
|
+
default_value: HardCider::DEFAULTS[:frequency]
|
|
75
|
+
|
|
76
|
+
c.flag %i[t timeout],
|
|
77
|
+
desc: 'Timeout',
|
|
78
|
+
type: Integer,
|
|
79
|
+
default_value: HardCider::DEFAULTS[:timeout]
|
|
80
|
+
|
|
81
|
+
c.action do |_global_options, options, _args|
|
|
82
|
+
defaults = { before_wait: -> { print '.' } }
|
|
83
|
+
result = HardCider.wait(Utils.underscore_keys(options).merge(defaults).reject { |_k, v| v.nil? })
|
|
84
|
+
|
|
85
|
+
print "\n"
|
|
86
|
+
|
|
87
|
+
raise IPANotProcessed unless result
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
data/lib/hard_cider/client.rb
CHANGED
|
@@ -4,17 +4,62 @@ require 'app_store_connect'
|
|
|
4
4
|
|
|
5
5
|
module HardCider
|
|
6
6
|
class Client
|
|
7
|
+
# @param options [Hash]
|
|
7
8
|
def initialize(options = {})
|
|
8
9
|
@client = AppStoreConnect::Client.new(options)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
# @param bundle_id [String]
|
|
13
|
+
# @return [Hash]
|
|
14
|
+
def latest_build(bundle_id)
|
|
15
|
+
response = @client.builds(
|
|
16
|
+
limit: 1,
|
|
17
|
+
filter: {
|
|
18
|
+
app: app_id(bundle_id)
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
response.dig(:data, 0)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @param bundle_id [String]
|
|
26
|
+
# @return [String]
|
|
27
|
+
def latest_build_processed?(bundle_id)
|
|
28
|
+
processing_state = latest_build(bundle_id).dig(:attributes, :processing_state)
|
|
29
|
+
|
|
30
|
+
processing_state == 'VALID'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
# @param bundle_id [String]
|
|
36
|
+
def apps(bundle_id)
|
|
37
|
+
response = @client.apps(
|
|
38
|
+
filter: {
|
|
39
|
+
bundle_id: bundle_id
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
response[:data]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @param bundle_id [String]
|
|
47
|
+
# @return [Hash]
|
|
48
|
+
def app(bundle_id)
|
|
49
|
+
apps(bundle_id).detect do |data|
|
|
50
|
+
data.dig(:attributes, :bundle_id) == bundle_id
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# @param bundle_id [String]
|
|
55
|
+
# @return [String]
|
|
56
|
+
def app_id(bundle_id)
|
|
57
|
+
@app_id ||= {}
|
|
58
|
+
@app_id[bundle_id] ||= begin
|
|
59
|
+
app(bundle_id)&.[](:id)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
@app_id[bundle_id]
|
|
18
63
|
end
|
|
19
64
|
end
|
|
20
65
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HardCider
|
|
4
|
+
module Utils
|
|
5
|
+
# @param hash [Hash]
|
|
6
|
+
# @return [Hash]
|
|
7
|
+
def self.underscore_keys(hash)
|
|
8
|
+
hash.map { |k, v| [underscore(k), v] }.to_h
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# @param string_or_symbol [String|Symbol]
|
|
12
|
+
# @return [Symbol]
|
|
13
|
+
def self.underscore(string_or_symbol)
|
|
14
|
+
string_or_symbol.to_s.gsub('-', '_').to_sym
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/hard_cider/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hard_cider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Decot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-02-
|
|
11
|
+
date: 2020-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -28,16 +28,16 @@ dependencies:
|
|
|
28
28
|
name: pry
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 0.12.2
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 0.12.2
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rake
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -70,42 +70,88 @@ dependencies:
|
|
|
70
70
|
name: rubocop
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
75
|
+
version: 0.79.0
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
82
|
+
version: 0.79.0
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: simplecov
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.16.1
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.16.1
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: webmock
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 3.6.0
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 3.6.0
|
|
83
111
|
- !ruby/object:Gem::Dependency
|
|
84
112
|
name: app_store_connect
|
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
|
86
114
|
requirements:
|
|
87
|
-
- -
|
|
115
|
+
- - '='
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 0.19.0
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - '='
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 0.19.0
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: gli
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
88
130
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
131
|
+
version: 2.19.0
|
|
90
132
|
type: :runtime
|
|
91
133
|
prerelease: false
|
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
135
|
requirements:
|
|
94
|
-
- - "
|
|
136
|
+
- - "~>"
|
|
95
137
|
- !ruby/object:Gem::Version
|
|
96
|
-
version:
|
|
138
|
+
version: 2.19.0
|
|
97
139
|
description: Wait for your IPAs to be Processed
|
|
98
140
|
email:
|
|
99
141
|
- kyle.decot@icloud.com
|
|
100
|
-
executables:
|
|
142
|
+
executables:
|
|
143
|
+
- hard_cider
|
|
101
144
|
extensions: []
|
|
102
145
|
extra_rdoc_files: []
|
|
103
146
|
files:
|
|
104
|
-
- ".github/
|
|
147
|
+
- ".github/workflows/lint.yml"
|
|
148
|
+
- ".github/workflows/test.yml"
|
|
105
149
|
- ".gitignore"
|
|
106
150
|
- ".rspec"
|
|
107
151
|
- ".rubocop.yml"
|
|
108
|
-
- ".
|
|
152
|
+
- ".ruby-version"
|
|
153
|
+
- ".yamllint"
|
|
154
|
+
- CODE_OF_CONDUCT.md
|
|
109
155
|
- Gemfile
|
|
110
156
|
- Gemfile.lock
|
|
111
157
|
- LICENSE.txt
|
|
@@ -113,9 +159,12 @@ files:
|
|
|
113
159
|
- Rakefile
|
|
114
160
|
- bin/console
|
|
115
161
|
- bin/setup
|
|
162
|
+
- exe/hard_cider
|
|
116
163
|
- hard_cider.gemspec
|
|
117
164
|
- lib/hard_cider.rb
|
|
165
|
+
- lib/hard_cider/cli.rb
|
|
118
166
|
- lib/hard_cider/client.rb
|
|
167
|
+
- lib/hard_cider/utils.rb
|
|
119
168
|
- lib/hard_cider/version.rb
|
|
120
169
|
homepage: https://github.com/kyledecot/hard_cider
|
|
121
170
|
licenses:
|
|
@@ -136,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
136
185
|
- !ruby/object:Gem::Version
|
|
137
186
|
version: '0'
|
|
138
187
|
requirements: []
|
|
139
|
-
|
|
140
|
-
rubygems_version: 2.7.6.2
|
|
188
|
+
rubygems_version: 3.0.3
|
|
141
189
|
signing_key:
|
|
142
190
|
specification_version: 4
|
|
143
191
|
summary: Wait for your IPAs to be Processed
|
data/.github/test.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
schedule:
|
|
6
|
-
- cron: 0 2 * * 1-5
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
rspec:
|
|
10
|
-
name: RSpec
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@master
|
|
15
|
-
- name: Set up Ruby 2.6
|
|
16
|
-
uses: actions/setup-ruby@v1
|
|
17
|
-
with:
|
|
18
|
-
ruby-version: 2.6.x
|
|
19
|
-
- name: Install dependencies
|
|
20
|
-
run: |
|
|
21
|
-
gem install bundler
|
|
22
|
-
bundle install --jobs=3 --retry=3
|
|
23
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
24
|
-
chmod +x ./cc-test-reporter
|
|
25
|
-
./cc-test-reporter before-build
|
|
26
|
-
- name: Run rspec
|
|
27
|
-
run: |
|
|
28
|
-
rspec
|
|
29
|
-
./cc-test-reporter after-build --exit-code $? -t simplecov
|
|
30
|
-
env:
|
|
31
|
-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|