Skip to content
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

update README.md/gemspec; migrate to GitHub actions #456

Merged
merged 3 commits into from
Sep 2, 2021
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
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'voxpupuli'
steps:
- uses: actions/checkout@v2
- name: Install Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
env:
BUNDLE_WITHOUT: release
Comment on lines +18 to +19
Copy link
Member

Choose a reason for hiding this comment

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

This is useless. There is no bundler involved so it can be dropped.

- name: Build gem
run: gem build *.gemspec
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
Copy link
Member

Choose a reason for hiding this comment

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

32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
- pull_request
- push

env:
BUNDLE_WITHOUT: release

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ruby: "2.4"
- ruby: "2.5"
coverage: "yes"
env:
COVERAGE: ${{ matrix.coverage }}
steps:
- uses: actions/checkout@v2
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Build gem
run: gem build *.gemspec
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

19 changes: 16 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
source "https://rubygems.org"
source 'https://rubygems.org'

gemspec

gem "json", ">= 1.7", :platforms => :mri_19
gem 'simplecov', :require => false
group :release do
gem 'github_changelog_generator', require: false
end

group :coverage, optional: ENV['COVERAGE']!='yes' do
gem 'simplecov-console', :require => false
gem 'codecov', :require => false
end

group :tests do
gem 'rubocop', '~> 1.11.0'
gem 'rubocop-rspec', '~> 2.2.0'
gem 'rubocop-rake', '~> 0.5.1'
gem 'rubocop-performance', '~> 1.10.2'
end
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[![Gem Version](https://badge.fury.io/rb/json-schema.svg)](https://badge.fury.io/rb/json-schema)
[![Travis](https://travis-ci.org/ruby-json-schema/json-schema.svg?branch=master)](https://travis-ci.org/ruby-json-schema/json-schema)
[![Code Climate](https://codeclimate.com/github/ruby-json-schema/json-schema/badges/gpa.svg)](https://codeclimate.com/github/ruby-json-schema/json-schema)
# Ruby JSON Schema Validator

Ruby JSON Schema Validator
==========================
[![License](https://img.shields.io/github/license/voxpupuli/json-schema.svg)](https://github.com/voxpupuli/json-schema/blob/master/LICENSE)
[![Test](https://github.com/voxpupuli/json-schema/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/json-schema/actions/workflows/test.yml)
[![Release](https://github.com/voxpupuli/json-schema/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/json-schema/actions/workflows/release.yml)
[![RubyGem Version](https://img.shields.io/gem/v/json-schema.svg)](https://rubygems.org/gems/json-schema)
[![RubyGem Downloads](https://img.shields.io/gem/dt/json-schema.svg)](https://rubygems.org/gems/json-schema)
[![Donated by Iain Beeston](https://img.shields.io/badge/donated%20by-Iain%20Beeston-fb7047.svg)](#transfer-notice)

This library is intended to provide Ruby with an interface for validating JSON
objects against a JSON schema conforming to [JSON Schema Draft
Expand Down Expand Up @@ -472,3 +474,23 @@ value is of the correct datatype (e.g., an instance value is validated to be an
integer or a float in the case of 'utc-millisec').

Additionally, JSON::Validator does not handle any json hyperschema attributes.

# Transfer Notice

This plugin was originally authored by [Iain Beeston](https://github.com/iainbeeston).
The maintainer preferred that [Vox Pupuli](https://voxpupuli.org/) take ownership of the module for future improvement and maintenance.
Existing pull requests and issues were transferred, please fork and continue to contribute [here](https://github.com/voxpupuli/json-schema).

# License

This gem is licensed unter the [MIT license](LICENSE.md).

## Release information

To make a new release, please do:
* update the version in VERSION.yml
* Install gems with `bundle install --with release --path .vendor`
* generate the changelog with `bundle exec rake changelog`
* Check if the new version matches the closed issues/PRs in the changelog
* Create a PR with it
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
5 changes: 0 additions & 5 deletions gemfiles/Gemfile.multi_json.x

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/Gemfile.ruby_19.x

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile.uuidtools.x

This file was deleted.

5 changes: 0 additions & 5 deletions gemfiles/Gemfile.yajl-ruby.x

This file was deleted.

6 changes: 3 additions & 3 deletions json-schema.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ gem_name = "json-schema"
Gem::Specification.new do |s|
s.name = gem_name
s.version = version
s.authors = ["Kenny Hoxworth"]
s.email = "[email protected]"
s.homepage = "http://github.com/ruby-json-schema/json-schema/tree/master"
s.authors = ["Kenny Hoxworth", "Vox Pupuli"]
s.email = "[email protected]"
s.homepage = "http://github.com/voxpupuli/json-schema/"
s.summary = "Ruby JSON Schema Validator"
s.files = Dir[ "lib/**/*", "resources/*.json" ]
s.require_path = "lib"
Expand Down
23 changes: 21 additions & 2 deletions test/support/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
if ENV['COVERAGE']
# frozen_string_literal: true

begin
require 'simplecov'
require 'simplecov-console'
require 'codecov'
rescue LoadError
else
SimpleCov.start do
add_filter '/test/'
track_files 'lib/**/*.rb'

add_filter '/test'

enable_coverage :branch

# do not track vendored files
add_filter '/vendor'
add_filter '/.vendor'
end

SimpleCov.formatters = [
SimpleCov::Formatter::Console,
SimpleCov::Formatter::Codecov,
]
end

require 'minitest/autorun'
Expand Down