Skip to content

Commit

Permalink
bump to 0.4.0 (#22)
Browse files Browse the repository at this point in the history
* bump to 0.4.0

* compute checksum from the gemspec file

* Add release workflow to CircleCI pipeline

Signed-off-by: Matteo Joliveau <[email protected]>

* Add shell.nix for Nix support

Signed-off-by: Matteo Joliveau <[email protected]>

* Fix yaml indentation

Signed-off-by: Matteo Joliveau <[email protected]>

* Fix workflow filters

Signed-off-by: Matteo Joliveau <[email protected]>

* fix tests

Co-authored-by: Matteo Joliveau <[email protected]>
  • Loading branch information
bernardini687 and MatteoJoliveau committed Jan 21, 2021
1 parent 0914fe9 commit e80424a
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 95 deletions.
56 changes: 51 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
version: 2
jobs:
build:
test:
docker:
- image: circleci/ruby:2.6.0
environment:
- image: circleci/ruby:2.7.0
working_directory: ~/repo

steps:
- checkout
- restore_cache:
name: Restore Bundle cache
keys:
- bundle-{{ checksum "Gemfile.lock" }}
- bundle-{{ checksum "onesignal-ruby.gemspec" }}
- bundle-
- run:
name: Install dependencies
Expand All @@ -21,7 +20,7 @@ jobs:
name: Save Bundle cache
paths:
- ./vendor/bundle
key: bundle-{{ checksum "Gemfile.lock" }}
key: bundle-{{ checksum "onesignal-ruby.gemspec" }}

- run:
name: Run tests
Expand All @@ -40,3 +39,50 @@ jobs:
- store_artifacts:
path: /tmp/test-results
destination: test-results
release:
docker:
- image: circleci/ruby:2.7.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
name: Restore Bundle cache
keys:
- bundle-{{ checksum "onesignal-ruby.gemspec" }}
- bundle-
- run:
name: Install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
name: Save Bundle cache
paths:
- ./vendor/bundle
key: bundle-{{ checksum "onesignal-ruby.gemspec" }}

- run:
name: Package gem
command: gem build --output release.gem

- run:
name: Publish gem
command: gem push release.gem

workflows:
version: 2
test:
jobs:
- test
test_release:
jobs:
- test:
filters: &release-filters
branches:
ignore: /.*/
tags:
only: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- release:
requires:
- test
filters:
<<: *release-filters
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_nix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
.env
.env.*
*.gem

Gemfile.lock
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.0
85 changes: 0 additions & 85 deletions Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion lib/onesignal/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module OneSignal
VERSION = '0.3.0'
VERSION = '0.4.0'
API_VERSION = 'v1'
end
2 changes: 1 addition & 1 deletion onesignal-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.16'
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'dotenv', '~> 2.5'
spec.add_development_dependency 'factory_bot', '~> 4.11'
spec.add_development_dependency 'rake', '~> 13.0'
Expand Down
7 changes: 7 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
with import <nixpkgs> {};

pkgs.mkShell {
buildInputs = [
ruby_2_7
];
}
2 changes: 1 addition & 1 deletion spec/onesignal/notification/contents_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

describe Notification::Contents do
it 'requires at least an english content' do
expect { described_class.new }.to raise_error ArgumentError, 'missing keyword: en'
expect { described_class.new }.to raise_error ArgumentError, /en/
end

it 'creates a new Content with only english' do
Expand Down
2 changes: 1 addition & 1 deletion spec/onesignal/notification/headings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

describe Notification::Headings do
it 'requires at least an english content' do
expect { described_class.new }.to raise_error ArgumentError, 'missing keyword: en'
expect { described_class.new }.to raise_error ArgumentError, /en/
end

it 'creates a new Content with only english' do
Expand Down
2 changes: 1 addition & 1 deletion spec/onesignal/segment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe Segment do
it 'requires a name' do
expect { described_class.new }.to raise_error ArgumentError, 'missing keyword: name'
expect { described_class.new }.to raise_error ArgumentError, /name/
end

context 'json' do
Expand Down

0 comments on commit e80424a

Please sign in to comment.