Skip to content

Commit c1e318d

Browse files
cdaviisChris Davis (Personal)
authored andcommitted
Create gem-push.yml and added rubocop file
1 parent d61dbba commit c1e318d

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

.github/workflows/gem-push.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Ruby Gem
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
types: [closed]
7+
8+
jobs:
9+
build:
10+
name: Build + Publish
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Ruby 3.2.2
21+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
22+
with:
23+
ruby-version: 3.2.2
24+
25+
- name: Publish to GitHub Packages
26+
run: |
27+
mkdir -p $HOME/.gem
28+
touch $HOME/.gem/credentials
29+
chmod 0600 $HOME/.gem/credentials
30+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
31+
gem build *.gemspec
32+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
33+
env:
34+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
35+
OWNER: ${{ github.repository_owner }}
36+
37+
- name: Publish to RubyGems.org
38+
run: |
39+
mkdir -p $HOME/.gem
40+
touch $HOME/.gem/credentials
41+
chmod 0600 $HOME/.gem/credentials
42+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
43+
gem build *.gemspec
44+
gem push *.gem
45+
env:
46+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AllCops:
2+
SuggestExtensions: false
3+
NewCops: disable
4+
5+
Style/StringLiterals:
6+
Enabled: true

beeceptor_ruby.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
1111
spec.description = "Allows users to use Beeceptor's REST API."
1212
spec.homepage = 'https://github.com/chrisdavis179/beeceptor_ruby'
1313
spec.license = 'MIT'
14-
spec.required_ruby_version = '>= 2.6.0'
14+
spec.required_ruby_version = '>= 3.2.2'
1515

1616
# Specify which files should be added to the gem when it is released.
1717
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
2727
spec.add_dependency 'faraday'
2828
spec.add_dependency 'json'
2929
spec.add_dependency 'rspec', '~> 3.7'
30+
spec.add_dependency 'rubocop'
3031

3132
# For more information and examples about making a new gem, check out our
3233
# guide at: https://bundler.io/guides/creating_gem.html

lib/beeceptor_ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module BeeceptorRuby
4-
VERSION = '0.1.0'
4+
VERSION = '0.4.0'
55
end

0 commit comments

Comments
 (0)