Skip to content

Commit

Permalink
Merge pull request #456 from voxpupuli/migrate
Browse files Browse the repository at this point in the history
update README.md/gemspec;  migrate to GitHub actions
  • Loading branch information
bastelfreak committed Sep 2, 2021
2 parents 11be9d6 + cdab313 commit 450489b
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 65 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
@@ -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
- 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
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
@@ -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
@@ -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
@@ -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
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 = "hoxworth@gmail.com"
s.homepage = "http://github.com/ruby-json-schema/json-schema/tree/master"
s.authors = ["Kenny Hoxworth", "Vox Pupuli"]
s.email = "voxpupuli@groups.io"
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
@@ -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

0 comments on commit 450489b

Please sign in to comment.