Skip to content

Commit 78fc19b

Browse files
authored
Merge pull request #8 from qonto/github-actions
Switch to github actions
2 parents a58c34e + ebe15a2 commit 78fc19b

File tree

5 files changed

+73
-25
lines changed

5 files changed

+73
-25
lines changed

.github/workflows/rubygems.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Ruby Gem
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- lib/version.rb
9+
10+
jobs:
11+
build:
12+
name: Build and publish
13+
runs-on: ubuntu-latest
14+
environment: master
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Ruby 3.2
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: 3.2.2
25+
26+
- name: Publish to RubyGems
27+
run: |
28+
mkdir -p $HOME/.gem
29+
touch $HOME/.gem/credentials
30+
chmod 0600 $HOME/.gem/credentials
31+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
32+
gem build *.gemspec
33+
gem push *.gem
34+
env:
35+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
ruby-version: ['3.0', '3.1', '3.2']
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: ${{ matrix.ruby-version }}
25+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26+
- name: Run tests
27+
run: bundle exec rake

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Idempotent Request [![Build Status](https://travis-ci.org/qonto/idempotent-request.svg?branch=master)](https://travis-ci.org/qonto/idempotent-request)
1+
![Gem Version](https://badge.fury.io/rb/idempotent-request.svg) ![CI Status](https://github.com/qonto/idempotent-request/actions/workflows/tests.yml/badge.svg)
2+
3+
# Idempotent Requestidempotent-request
24

35
Rack middleware ensuring at most once requests for mutating endpoints.
46

@@ -140,11 +142,11 @@ Get notified when a client sends a request with the same idempotency key:
140142
```ruby
141143
class RailsCallback
142144
attr_reader :request
143-
145+
144146
def initialize(request)
145147
@request = request
146148
end
147-
149+
148150
def detected(key:)
149151
Rails.logger.warn "IdempotentRequest request detected, key: #{key}"
150152
end
@@ -166,3 +168,8 @@ The gem is available as open source under the terms of the [MIT License](http://
166168
## Code of Conduct
167169

168170
Everyone interacting in the Idempotent::Request project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/idempotent-request/blob/master/CODE_OF_CONDUCT.md).
171+
172+
173+
## Releasing
174+
175+
To publish a new version to rubygems, update the version in `lib/version.rb`, and merge.

lib/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module IdempotentRequest
2-
VERSION = "0.1.7"
2+
VERSION = "0.2.0"
33
end

0 commit comments

Comments
 (0)