-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare CI with GitHub actions for publishing #428
Draft
justinhoward
wants to merge
2
commits into
master
Choose a base branch
from
prepare-for-ci-publishing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 |
---|---|---|
@@ -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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should 3.3 be included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.