deploygate 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a067b187ce090f469740902b25df05047db95908131057a995481c4a023b11bd
4
- data.tar.gz: 8d67c1abb0a90436120bdfd45e0831b9002a7b2089c46a3d42cd3ac7d985143c
3
+ metadata.gz: 205fe31f4fd075fe324796f70e1bacbd271415654c97813ac7bfd9dabcf72a88
4
+ data.tar.gz: 1d489557b2810cfdf378d8566cd7ac6723842c7ed2d9c29505f601d810db70b4
5
5
  SHA512:
6
- metadata.gz: 7a10f3ec84688ac65572f3ffb77a70f231436ae8222a6d2c7534a6e5cfa126eca71b4c8f2319ca8f7583c4257ae90896605b093af69dbcdc353e70f667307303
7
- data.tar.gz: e5abc3793a771f2c1ac96cbaa875a80ab47e665993c7f4a77790f45c983ab557fe4d94345e34d03c9b2ad2ecbfada109bc6e2cacc50881c983da038c54740745
6
+ metadata.gz: 2d09762f900f984318f51724d8f047bb783f25f3082120f7ad16c2b229dbfe17c3933a1d59621a4fafcccf7009124b5c9b7cef8a254b8cd37cad6ff286618327
7
+ data.tar.gz: 6b9b2c2845aa72e70872df1663f331aa83eca0ec956970ac93e6e4c724d92e7c2168b208d80910c52508bf3875bb9278c9739653aeda1c0a4031a5225e70acc2
@@ -0,0 +1,21 @@
1
+ name: Run jobs on every PR
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ build:
8
+ strategy:
9
+ matrix:
10
+ ruby_version:
11
+ - 2.6
12
+ - 2.7
13
+ # - 3.0 # needs to upgrade fastlane and activesupport else
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby_version }}
20
+ bundler-cache: true
21
+ - run: bundle exec rake
@@ -0,0 +1,28 @@
1
+ name: Release built gem on tag-push
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ bundler-cache: true
16
+ - run: bundle exec rake build
17
+ - id: gem
18
+ run: echo "::set-output name=result::$(find pkg -name 'deploygate-*.gem' -type f | head -1)"
19
+ - run: |
20
+ curl --data-binary '@${{ steps.gem.outputs.result }}' \
21
+ -H 'Authorization: ${{ secrets.RUBYGEMS_API_KEY }}' \
22
+ "https://rubygems.org/api/v1/gems"
23
+ - uses: slackapi/slack-github-action@v1.16.0
24
+ with:
25
+ payload: "{\"text\": \"Released a deploygate gem in <https://rubygems.org/gems/deploygate/|RubyGems>\"}"
26
+ env:
27
+ SLACK_WEBHOOK_URL: ${{ secrets.SHARED_FOR_RELEASE_ARTIFACT_SLACK_INCOMING_WEBHOOK_URL }}
28
+ SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.5
1
+ 2.6.9
data/README.md CHANGED
@@ -9,7 +9,7 @@ dg: A command-line interface for DeployGate
9
9
 
10
10
  *dg* runs with a minimal set of requirements.
11
11
 
12
- - Ruby 2.4+ (Depends on [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/))
12
+ - Ruby 2.6+ (Depends on [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/))
13
13
 
14
14
  ## Installation
15
15
 
@@ -18,12 +18,14 @@ en:
18
18
  scheme: 'Set Xcode build scheme (iOS app only)'
19
19
  open: 'Open a browser after the build uploaded (OS X only)'
20
20
  disable_notify: 'Disable email notification (iOS app only)'
21
+ xcodeproj: 'The path to the target Xcode project file (iOS app only)'
21
22
  add_devices:
22
23
  description: 'Register devices to your Apple Developer account and refresh your provisioning profile. (iOS only) By default, it automatically finds new devices added to your application on DeployGate and ask you which device to register. You can also specify which device to register via command line options.'
23
24
  user: 'Owner user or organization name'
24
25
  udid: 'UDID to be registered'
25
26
  device_name: 'Device name to be registered'
26
27
  distribution_key: 'If you also want to update distribution page, set the last part of the URL of the page'
28
+ xcodeproj: 'The path to the target Xcode project file (iOS app only)'
27
29
  server:
28
30
  description: 'Start the add-devices server. When added new device automatically run add-devices command.'
29
31
  connecting: 'Connecting...'
@@ -4,6 +4,10 @@ module DeployGate
4
4
  class Base
5
5
  BASE_URL = ENV['DG_DEVELOP_URL'] || 'https://deploygate.com'
6
6
  API_BASE_URL = "#{BASE_URL}/api"
7
+ BASE_HEADERS = [
8
+ ['X-DEPLOYGATE-CLIENT-ID', "cli/#{::DeployGate::VERSION_CODE}"],
9
+ ['X-DEPLOYGATE-CLIENT-VERSION-NAME', ::DeployGate::VERSION],
10
+ ].freeze
7
11
 
8
12
  # @param [String] token
9
13
  # @return [DeployGate::API::V1::Base]
@@ -53,7 +57,8 @@ module DeployGate
53
57
  end
54
58
 
55
59
  def headers
56
- extheaders = []
60
+ extheaders = BASE_HEADERS.dup
61
+
57
62
  unless @token.nil?
58
63
  extheaders.push(['AUTHORIZATION', @token])
59
64
  end
@@ -70,6 +70,7 @@ module DeployGate
70
70
  c.option '--scheme STRING', String, I18n.t('command_builder.deploy.scheme')
71
71
  c.option '--open', I18n.t('command_builder.deploy.open')
72
72
  c.option '--disable_notify', I18n.t('command_builder.deploy.disable_notify')
73
+ c.option '--xcodeproj STRING', I18n.t('command_builder.deploy.xcodeproj')
73
74
  c.action do |args, options|
74
75
  options.default :message => '', :user => nil, :open => false, 'disable_notify' => false, :command => nil
75
76
  begin
@@ -91,6 +92,7 @@ module DeployGate
91
92
  c.option '--distribution-key STRING', String, I18n.t('command_builder.add_devices.distribution_key')
92
93
  c.option '--configuration STRING', String, I18n.t('command_builder.deploy.configuration')
93
94
  c.option '--server', I18n.t('command_builder.add_devices.server.description')
95
+ c.option '--xcodeproj STRING', I18n.t('command_builder.add_devices.xcodeproj')
94
96
  c.action do |args, options|
95
97
  options.default :user => nil, :server => false, :command => 'add_devices'
96
98
  begin
@@ -21,9 +21,12 @@ module DeployGate
21
21
  distribution_key = options.distribution_key
22
22
  server = options.server
23
23
 
24
+ build_configuration = options.configuration
25
+ xcodeproj_path = options.xcodeproj
26
+
24
27
  root_path = DeployGate::Xcode::Ios.project_root_path(work_dir)
25
28
  workspaces = DeployGate::Xcode::Ios.find_workspaces(root_path)
26
- analyze = DeployGate::Xcode::Analyze.new(workspaces, options.configuration)
29
+ analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, nil, xcodeproj_path)
27
30
  bundle_id = analyze.target_bundle_identifier
28
31
  developer_team = analyze.developer_team
29
32
  member_center = DeployGate::Xcode::MemberCenter.new(developer_team)
@@ -34,8 +34,9 @@ module DeployGate
34
34
  DeployGate::Xcode::Export.check_local_certificates
35
35
  build_configuration = options.configuration
36
36
  target_scheme = options.scheme
37
+ xcodeproj_path = options.xcodeproj
37
38
 
38
- analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, target_scheme)
39
+ analyze = DeployGate::Xcode::Analyze.new(workspaces, build_configuration, target_scheme, xcodeproj_path)
39
40
  target_scheme = analyze.scheme
40
41
 
41
42
  code_sign_identity = nil
@@ -1,3 +1,4 @@
1
1
  module DeployGate
2
- VERSION = '0.8.4'
2
+ VERSION = '0.8.5'
3
+ VERSION_CODE = Gem::Version.new(VERSION).segments.reverse.each_with_index.map { |v, i| 100 ** i * v }.reduce(&:+)
3
4
  end
@@ -1,7 +1,7 @@
1
1
  module DeployGate
2
2
  module Xcode
3
3
  class Analyze
4
- attr_reader :workspaces, :scheme_workspace, :build_workspace, :scheme, :xcodeproj
4
+ attr_reader :workspaces, :build_workspace, :scheme, :xcodeproj
5
5
 
6
6
  BASE_WORK_DIR_NAME = 'project.xcworkspace'
7
7
  DEFAULT_BUILD_CONFIGURATION = 'Release'
@@ -16,12 +16,11 @@ module DeployGate
16
16
  # @param [String] build_configuration
17
17
  # @param [String] target_scheme
18
18
  # @return [DeployGate::Xcode::Analyze]
19
- def initialize(workspaces, build_configuration = nil, target_scheme = nil)
19
+ def initialize(workspaces, build_configuration = nil, target_scheme = nil, xcodeproj_path = nil)
20
20
  @workspaces = workspaces
21
21
  @build_configuration = build_configuration || DEFAULT_BUILD_CONFIGURATION
22
- @scheme_workspace = find_scheme_workspace(workspaces)
23
22
  @build_workspace = find_build_workspace(workspaces)
24
- @xcodeproj = File.dirname(@scheme_workspace)
23
+ @xcodeproj = xcodeproj_path.presence || find_xcodeproj(workspaces)
25
24
 
26
25
  config = FastlaneCore::Configuration.create(Gym::Options.available_options, { project: @xcodeproj })
27
26
  Gym.config = config
@@ -114,18 +113,21 @@ module DeployGate
114
113
 
115
114
  # @param [Array] workspaces
116
115
  # @return [String]
117
- def find_scheme_workspace(workspaces)
116
+ def find_xcodeproj(workspaces)
118
117
  return nil if workspaces.empty?
119
- return workspaces.first if workspaces.count == 1
120
118
 
121
- select = nil
122
- workspaces.each do |workspace|
123
- if BASE_WORK_DIR_NAME == File.basename(workspace)
124
- select = workspace
119
+ if workspaces.count == 1
120
+ scheme_workspace = workspaces.first
121
+ else
122
+ scheme_workspace = nil
123
+ workspaces.each do |workspace|
124
+ if BASE_WORK_DIR_NAME == File.basename(workspace)
125
+ scheme_workspace = workspace
126
+ end
125
127
  end
126
128
  end
127
129
 
128
- select
130
+ scheme_workspace != nil ? File.dirname(scheme_workspace) : nil
129
131
  end
130
132
 
131
133
  # @param [Array] workspaces
data/lib/deploygate.rb CHANGED
@@ -36,6 +36,7 @@ require "xcodeproj"
36
36
  module DeployGate
37
37
  end
38
38
 
39
+ require "deploygate/version"
39
40
  require "deploygate/raven_ignore_exception"
40
41
  require "deploygate/api/v1/base"
41
42
  require "deploygate/api/v1/session"
@@ -72,4 +73,3 @@ require "deploygate/xcode/ios"
72
73
  require "deploygate/android/gradle_deploy"
73
74
  require "deploygate/android/gradle_plugin_installer"
74
75
  require "deploygate/android/gradle_project"
75
- require "deploygate/version"
@@ -1,2 +1,70 @@
1
1
  describe DeployGate::Xcode::Analyze do
2
+ describe '#new' do
3
+ subject { described_class.new(workspaces, build_configuration, target_scheme, xcodeproj) }
4
+
5
+ let(:build_configuration) { nil }
6
+ let(:target_scheme) { nil }
7
+ let(:xcodeproj) { nil }
8
+
9
+ describe 'detect scheme workspace and build workspace' do
10
+ before do
11
+ allow(FastlaneCore::Configuration).to receive(:create)
12
+ project = instance_double(FastlaneCore::Project)
13
+ allow(project).to receive(:select_scheme)
14
+ allow(project).to receive(:schemes).and_return([])
15
+ allow(project).to receive(:options).and_return({})
16
+ allow(FastlaneCore::Project).to receive(:new).and_return(project)
17
+ allow(Gym).to receive(:config=)
18
+ end
19
+
20
+ context 'exists single xcodeproj files' do
21
+ let(:workspaces) do
22
+ %w[
23
+ /base_dir/Test/Test/Test.xcodeproj/project.xcworkspace
24
+ ]
25
+ end
26
+
27
+ context 'without scheme workspace arg' do
28
+ it 'build_workspace and xcodeproj is same' do
29
+ is_expected.to have_attributes(
30
+ build_workspace: '/base_dir/Test/Test/Test.xcodeproj/project.xcworkspace',
31
+ xcodeproj: '/base_dir/Test/Test/Test.xcodeproj'
32
+ )
33
+ end
34
+ end
35
+ end
36
+
37
+ context 'exists multiple xcodeproj files' do
38
+ let(:workspaces) do
39
+ %w[
40
+ /base_dir/Test/ALib/ALib.xcodeproj/project.xcworkspace
41
+ /base_dir/Test/Hoge/Hoge.xcodeproj/project.xcworkspace
42
+ /base_dir/Test/Test/Test.xcodeproj/project.xcworkspace
43
+ /base_dir/Test/Test.xcworkspace
44
+ /base_dir/Test/ZLib/ZLib.xcodeproj/project.xcworkspace
45
+ ]
46
+ end
47
+
48
+ context 'without scheme workspace arg' do
49
+ it 'scheme workspace is last workspace has project.xcworkspace' do
50
+ is_expected.to have_attributes(
51
+ build_workspace: '/base_dir/Test/Test.xcworkspace',
52
+ xcodeproj: '/base_dir/Test/ZLib/ZLib.xcodeproj'
53
+ )
54
+ end
55
+ end
56
+
57
+ context 'with scheme workspace arg' do
58
+ let(:xcodeproj) { './ZLib.xcodeproj' }
59
+
60
+ it 'scheme workspace is last workspace has project.xcworkspace' do
61
+ is_expected.to have_attributes(
62
+ build_workspace: '/base_dir/Test/Test.xcworkspace',
63
+ xcodeproj: './ZLib.xcodeproj'
64
+ )
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
2
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploygate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - deploygate
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -332,10 +332,11 @@ executables:
332
332
  extensions: []
333
333
  extra_rdoc_files: []
334
334
  files:
335
+ - ".github/workflows/pull_request.yml"
336
+ - ".github/workflows/release.yml"
335
337
  - ".gitignore"
336
338
  - ".rspec"
337
339
  - ".ruby-version"
338
- - ".travis.yml"
339
340
  - Gemfile
340
341
  - LICENSE.txt
341
342
  - README.md
@@ -424,8 +425,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
424
425
  - !ruby/object:Gem::Version
425
426
  version: '0'
426
427
  requirements: []
427
- rubygems_version: 3.0.8
428
- signing_key:
428
+ rubygems_version: 3.0.9
429
+ signing_key:
429
430
  specification_version: 4
430
431
  summary: A command-line interface for DeployGate
431
432
  test_files:
@@ -448,3 +449,4 @@ test_files:
448
449
  - spec/deploygate/xcode/member_centers/provisioning_profile_spec.rb
449
450
  - spec/spec_helper.rb
450
451
  - spec/test_files/DeployGateSample.apk
452
+ ...
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- language: ruby
2
- env:
3
- global:
4
- secure: gGY+C54Cfp082o5Oaf6tZqzfOlXsWSMcVNvTpoOgMfJGsHo//d9t/si9Bn1pFaFyjJedW+IcC0pt+FcKVCDgnsUaL0Y0HT/ZsGkV8k7vv9F5nbHOde4nk189Sr2HtHR3wdr7KaMh2/DialisnqllxgzxA/wRLfHKsjqRsjWUw/VWL5E7Z734mzpTGE2mVJNRj02/cs0Y/izZgdi6wrt4lEZfxE3jS+QkJZHMjGNfcwvH26whU6oX1PiJ4o5xl0Rr8Q8xav3wbtTCcOJNPSeMkkiH5sSXuqrjI6kgwvjlByKhyg2Ws0GvZLxAfTml+Vo5po1uWsohdZJaJcEhd4GsGfbMZWCFuBP2mCE+gVmkkMeJxRKnWoi6NotgPmqG1JWlzGngDB/hJ4wuuh+swa0KJvZGiMEJ5P3GNydCybEPOsk1Ww+lUkXRHxD+/LW03EkxMd5LA3He/nYXz3pWCYA6qcFgrYMmq+3ozjSaQr+1d/Iu14Awv5+cwCltPfl5bERDno0jc0TdSs/7qplAL/efpjBsP7DkGE5r521gg8mIiXx509jU08i9S60SXiw0RBnYyjE5SzlsiOqaFdJxVygDGcDIAA/GTefLHO9i3SinZHFS6jr3Xi/vpOIc7Jz4W2Jmuqv+CJP4gspPoAxdWOE/QipTt0Jv4kCMf7dJwd9jaRc=
5
- rvm:
6
- - 2.4
7
- - 2.5
8
- - 2.6
9
- - 2.7
10
- before_install:
11
- - gem install bundler -v 2.1.4
12
- install: BUNDLER_VERSION=2.1.4 bundle install --jobs=3 --retry=3
13
- script:
14
- - bundle exec rake
15
- deploy:
16
- provider: rubygems
17
- api_key:
18
- secure: sy649ijrSPFvCtR7cg/Hy2I7iY3WQxROyyw3hjoOU5wFxjNYh+DoDXmZiMmdRSNjO2GQIbeuX5sPhgHTleIlOl0c8QtYxwiky6O9WnT3lwOkxtnhI1H+sQCJxWV9Ur99GtYCzosfOgqvoiXqOIllI/mNzhO4Vru3Nc+E9pM1aM9jU9TIulDxOCSyteXvX+23DaiW8CNicFWEGhT4rSdDGqKbmZTjDKP2SanEthUp1N0AqZR9ACvqGCz7Q/5cXjoUFz89uBaNwyp3UrYhfP1niVgR3dp8ev23RbMUGsmVz8WVMOkrBbA2nSBF+fRsxuj5YO+J0knQY32sXpNH06jvJ8GvnbOwWD6wm7q4h1UOjvb29PamtRF4lSfxhZb848eHtipkNyuqCfWaeCrlpn5b49poBPZ1FTOC8C6o1LbFPAJwchttj5fcVReNVsa8+xt6TO6p/vti0WMptVUUHU5xSxG7t3FzRF1WTM09oSNnmfyI/rOQv1qgOP2RmNaJQl9iRCbyCTgU8kpL8BR2vswntxILj5Q9zl2M83zGo7mYB8EjvbPjWqVURzvww5Jl5BSJfiIgeLBq/cjb7h/oqvRqgolkfqwaudagRUY+Fgtlmic15gjs8aA9OfzShBigf5We/aZRaXLWjtOwJ5+GKsBbmi73mkyTn0cMFbTpDv3RVNE=
19
- gem: deploygate
20
- on:
21
- tags: true
22
- repo: DeployGate/deploygate-cli
23
- rvm: 2.4
24
- after_deploy:
25
- - 'curl -X POST --data-urlencode "payload={\"text\": \"Released a deploygate gem in <https://rubygems.org/gems/deploygate/|RubyGems>\"}" $SLACK_URL'