Skip to content

Commit

Permalink
Update to build with github actions / ruby 3.0 / rails 6.1 (#2)
Browse files Browse the repository at this point in the history
* Update to build with github actions / ruby 3.0 / rails 6.1

* Drop coverage

* Add release.yml

Co-authored-by: John Mortlock <john.mortlock@sealink.com.au>
  • Loading branch information
jmortlock and John Mortlock committed Jan 5, 2021
1 parent 27041eb commit 5740a56
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec rake

release:
needs: build
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Generate Changelog
run: |
# Get version from github ref (remove 'refs/tags/' and prefix 'v')
version="${GITHUB_REF#refs/tags/v}"
npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workflow }}-CHANGELOG.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: [build, release]
name: Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1

- 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_AUTH_TOKEN}}"
16 changes: 16 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build and Test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
vendor/
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## Unreleased
### Added

- [TT-8631] Update to build with github actions / ruby 3.0 / rails 6.1
- [TT-1392] Changelog file
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
InputReader
===========
# InputReader

[![Gem Version](https://badge.fury.io/rb/input_reader.svg)](http://badge.fury.io/rb/input_reader)
[![Build Status](https://travis-ci.org/sealink/input_reader.png?branch=master)](https://travis-ci.org/sealink/input_reader)
[![Build Status](https://gemnasium.com/sealink/input_reader.png?travis)](https://gemnasium.com/sealink/input_reader)
[![Build Status](https://codeclimate.com/github/sealink/input_reader.png)](https://codeclimate.com/github/sealink/input_reader)

Reads and parses input and helps build input menus, etc.
Expand All @@ -25,6 +24,19 @@ Or install it yourself as:

TODO: Write usage instructions here

## Release

To publish a new version of this gem the following steps must be taken.

- Update the version in the following files
```
CHANGELOG.md
lib/input_reader/version.rb
```
- Create a tag using the format v0.1.0
- Follow build progress in GitHub actions


## Contributing

1. Fork it
Expand Down
3 changes: 2 additions & 1 deletion input_reader.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Gem::Specification.new do |gem|
gem.name = "input_reader"
gem.require_paths = ["lib"]
gem.version = InputReader::VERSION
gem.required_ruby_version = '>= 2.6'

gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'coverage-kit'
gem.add_development_dependency 'simplecov-rcov'
gem.add_development_dependency 'guard-rspec'
gem.add_development_dependency 'coveralls'
gem.add_development_dependency 'travis'
gem.add_development_dependency 'pry-byebug'
end
2 changes: 1 addition & 1 deletion spec/support/coverage_loader.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'simplecov-rcov'
require 'coveralls'
require 'coverage/kit'
Coverage::Kit.setup(minimum_coverage: 94.7)
Coverage::Kit.setup(minimum_coverage: 94.65)

0 comments on commit 5740a56

Please sign in to comment.