Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 113 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,131 @@ name: Run jobs on every PR

on:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 1 * * *" # everyday at 10am JST

jobs:
build:
build-ruby2:
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.6
- 2.7
# - 3.0 # needs to upgrade fastlane and activesupport else
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: gem update --system 3.4.22 # The latest of Ruby 2.x support
- run: bundle exec rake

build-ruby3:
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.0
- 3.1
- 3.2
- 3.3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: gem update --system
- run: bundle exec rake

instrument-ruby2:
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.6
- 2.7
services:
app:
image: ghcr.io/deploygate/deploygate-mock-server:main
ports:
- 3000/tcp
options: >-
--health-cmd "curl -fI http://localhost:3000"
--health-interval 15s
--health-timeout 5s
--health-retries 5
--health-start-period 20s
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: gem update --system 3.4.22 # The latest of Ruby 2.x support
- run: ./bin/dg deploy spec/fixtures/sample.apk
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'
- run: ./bin/dg deploy spec/fixtures/sample.aab
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'
- run: ./bin/dg deploy spec/fixtures/sample.ipa
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'

instrument-ruby3:
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.0
- 3.1
- 3.2
- 3.3
services:
app:
image: ghcr.io/deploygate/deploygate-mock-server:main
ports:
- 3000/tcp
options: >-
--health-cmd "curl -fI http://localhost:3000"
--health-interval 15s
--health-timeout 5s
--health-retries 5
--health-start-period 20s
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: gem update --system
- run: ./bin/dg deploy spec/fixtures/sample.apk
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'
- run: ./bin/dg deploy spec/fixtures/sample.aab
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'
- run: ./bin/dg deploy spec/fixtures/sample.ipa
env:
DG_DEVELOP_URL: http://localhost:${{ job.services.app.ports[3000] }}
DG_USER_NAME: 'owner_test'
DG_TOKEN: 'owner_test'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ spec/test_files/.dg
# binary files
*.app.dSYM.zip
*.ipa
*.apk
*.aab

.DS_Store

!/spec/fixtures/*.apk
!/spec/fixtures/*.aab
!/spec/fixtures/*.ipa
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ dg: A command-line interface for DeployGate

## Requirements

*dg* runs with a minimal set of requirements.

- Ruby 2.6+ (Depends on [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/))

## Installation
Expand All @@ -17,6 +15,9 @@ Add this line to your application's Gemfile:

```
gem 'deploygate'

# Only when you are using Ruby 2.x
gem 'multi_xml' '~> 0.6.0'
```

And then execute:
Expand All @@ -28,6 +29,7 @@ $ bundle
Or install it yourself as:

```
$ gem install 'multi_xml' -v '~> 0.6.0' # Run this only when you are using Ruby 2.x
$ gem install deploygate
```

Expand Down
6 changes: 5 additions & 1 deletion bin/dg
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)

require "deploygate"

DeployGate::CommandBuilder.new().run
DeployGate::CommandBuilder.new.run
9 changes: 6 additions & 3 deletions deploygate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dg installed! To get started fast:

POST_INSTALL_MESSAGE

spec.required_ruby_version = '>= 2.6'

spec.add_runtime_dependency 'json', '~> 2.0'
spec.add_runtime_dependency 'httpclient', '~> 2.8'
spec.add_runtime_dependency 'commander', '~> 4.4'
Expand All @@ -28,14 +30,15 @@ POST_INSTALL_MESSAGE
spec.add_runtime_dependency 'highline', '~> 2.0'
spec.add_runtime_dependency 'uuid', '~> 2.3'
spec.add_runtime_dependency 'gem_update_checker', '~> 0.2'
spec.add_runtime_dependency 'activesupport', '~> 4.2'
spec.add_runtime_dependency 'i18n', '~> 0.7'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand to delete this line because i18n gem was bundled with after Rails3.

spec.add_runtime_dependency 'activesupport', '~> 6.1'
spec.add_runtime_dependency 'launchy', '~> 2.4'
spec.add_runtime_dependency 'locale', '~> 2.1'
spec.add_runtime_dependency 'net-ping', '~> 2.0'
spec.add_runtime_dependency 'socket.io-client-simple', '~> 1.2'
spec.add_runtime_dependency 'workers', '~> 0.6'
spec.add_runtime_dependency 'sentry-ruby', '~> 5.8'
# Webrick has been removed from bundled gems since Ruby 3
spec.add_runtime_dependency 'webrick', '~> 1.8'

# ios build
spec.add_runtime_dependency 'fastlane', '~> 2.212.1'
Expand All @@ -44,7 +47,7 @@ POST_INSTALL_MESSAGE
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec', '~> 3.5'
spec.add_development_dependency 'webmock', '~> 2.3'
spec.add_development_dependency 'i18n-tasks', '~> 0.9'
spec.add_development_dependency 'i18n-tasks', '~> 1.0'

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Expand Down
1 change: 1 addition & 0 deletions lib/deploygate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require "gem_update_checker"
require "active_support/core_ext/time"
require "active_support/core_ext/hash"
require "active_support/core_ext/integer/time"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

active support has moved Numeric extension like 1.days from core_ext/time to here.

require "locale"
require "tempfile"
require "open3"
Expand Down
2 changes: 1 addition & 1 deletion lib/deploygate/api/v1/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def headers
extheaders = BASE_HEADERS.dup

unless @token.nil?
extheaders.push(['AUTHORIZATION', @token])
extheaders.push(['AUTHORIZATION', "token #{@token}"])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token header prefix is preferred.

end

extheaders
Expand Down
1 change: 0 additions & 1 deletion lib/deploygate/commands/deploy/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module DeployGate
module Commands
module Deploy
class Push
BASE_URL = 'https://deploygate.com'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused.

COMMAND = 'push'

class << self
Expand Down
4 changes: 2 additions & 2 deletions spec/deploygate/api/v1/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:results => {'name' => name}
}
stub_request(:get, "#{API_ENDPOINT}/sessions/user").
with(:headers => { 'AUTHORIZATION' => token }).
with(:headers => { 'AUTHORIZATION' => "token #{token}" }).
to_return(:body => response.to_json)


Expand All @@ -24,7 +24,7 @@
:because => 'error message'
}
stub_request(:get, "#{API_ENDPOINT}/sessions/user").
with(:headers => { 'AUTHORIZATION' => token }).
with(:headers => { 'AUTHORIZATION' => "token #{token}" }).
to_return(:body => response.to_json)

results = DeployGate::API::V1::Session.show(token)
Expand Down
Binary file added spec/fixtures/sample.aab
Binary file not shown.
Binary file added spec/fixtures/sample.apk
Binary file not shown.
Binary file added spec/fixtures/sample.ipa
Binary file not shown.