-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare CI with GitHub actions for publishing
- Loading branch information
1 parent
b23eee4
commit a604002
Showing
11 changed files
with
121 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
name: CI | ||
on: | ||
push: | ||
tags: ['v*'] | ||
branches: [master] | ||
pull_request: | ||
branches: ['**'] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: | ||
- '2.1' | ||
- '2.3' | ||
- '2.4' | ||
- '2.5' | ||
- '2.6' | ||
- '2.7' | ||
- '3.0' | ||
- '3.1' | ||
- '3.2' | ||
- jruby-head | ||
- truffleruby-head | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- run: bundle exec rspec --format doc | ||
- uses: codecov/codecov-action@v3 | ||
if: matrix.ruby == '3.2' | ||
with: | ||
files: coverage/coverage.xml | ||
|
||
yard: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.7' | ||
bundler-cache: true | ||
- run: bundle exec yardoc --fail-on-warning | ||
|
||
check_version: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.7' | ||
bundler-cache: true | ||
- run: bin/check-version | ||
|
||
release: | ||
needs: [test, yard, check_version] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Publish to RubyGems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push *.gem | ||
env: | ||
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
--color | ||
--exclude_pattern spec/requests/as_content_owner/*_spec.rb | ||
--tag=~slow | ||
--exclude-pattern spec/requests/as_content_owner/*_spec.rb |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in yt.gemspec | ||
gemspec | ||
gemspec | ||
|
||
not_jruby = %i[ruby mingw x64_mingw].freeze | ||
|
||
# We add non-essential gems like debugging tools and CI dependencies | ||
# here. This also allows us to use conditional dependencies that depend on the | ||
# platform | ||
gem 'pry', platforms: not_jruby | ||
gem 'simplecov' | ||
gem 'simplecov-cobertura' | ||
gem 'yard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
tag="$(git describe --abbrev=0 2>/dev/null || echo)" | ||
echo "Tag: ${tag}" | ||
tag="${tag#v}" | ||
echo "Git Version: ${tag}" | ||
[ "$tag" = '' ] && exit 0 | ||
gem_version="$(ruby -r ./lib/yt/version -e "puts Yt::VERSION" | tail -n1)" | ||
echo "Gem Version: ${gem_version}" | ||
|
||
tag_gt_version="$(ruby -r ./lib/yt/version -e "puts Gem::Version.new(Yt::VERSION) >= Gem::Version.new('${tag}')" | tail -n1)" | ||
test "$tag_gt_version" = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,32 +5,25 @@ require 'yt/version' | |
Gem::Specification.new do |spec| | ||
spec.name = "yt" | ||
spec.version = Yt::VERSION | ||
spec.authors = ["Claudio Baccigalupo"] | ||
spec.email = ["[email protected]"] | ||
spec.authors = ["Nullscreen"] | ||
spec.email = ["[email protected]"] | ||
spec.description = %q{Youtube V3 API client.} | ||
spec.summary = %q{Yt makes it easy to interact with Youtube V3 API by | ||
providing a modular, intuitive and tested Ruby-style API.} | ||
spec.homepage = "http://github.com/Fullscreen/yt" | ||
spec.homepage = "http://github.com/nullscreen/yt" | ||
spec.license = "MIT" | ||
|
||
spec.required_ruby_version = '>= 2.1' | ||
|
||
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do | ||
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
end | ||
|
||
spec.files = Dir['lib/**/*.rb', '*.md', '*.txt', '.yardopts', 'MIT-LICENSE'] | ||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency 'activesupport' | ||
|
||
# For development / Code coverage / Documentation | ||
spec.add_development_dependency 'bundler' | ||
spec.add_development_dependency 'rspec' | ||
spec.add_development_dependency 'rake' | ||
# spec.add_development_dependency 'yard' | ||
# spec.add_development_dependency 'coveralls' | ||
spec.add_development_dependency 'pry' | ||
spec.add_development_dependency 'vcr' | ||
spec.add_development_dependency 'webmock' | ||
end |