Skip to content

Commit

Permalink
Add gem version badge in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar1202 committed Sep 15, 2024
1 parent 32225b3 commit 65765f1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,46 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
- uses: ruby/setup-ruby
with:
ruby-version: '3.3.1'
- run: bundle install
- run: bundle exec rspec

build:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up Ruby 3.3.1
uses: ruby/setup-ruby
with:
ruby-version: '3.3.1'
- run: bundle install

- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}

- 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}}"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Gojira

[![Gem Version](https://badge.fury.io/rb/gojira_apiops.svg)](https://badge.fury.io/rb/gojira_apiops)

**Maintaining order within the Kong realm** [[ref](https://en.wikipedia.org/wiki/Gojira)]

<img src="docs/gojira.png" alt="drawing" width="500"/>
Expand Down
8 changes: 4 additions & 4 deletions gojira.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'gojira/version'

Gem::Specification.new do |spec|
spec.name = 'gojira'
spec.name = 'gojira_apiops'
spec.version = Gojira::VERSION
spec.authors = ['Kumar Abhijeet']
spec.email = ['kumarabhijeet1202@gmail.com']
Expand All @@ -17,11 +17,11 @@ Gem::Specification.new do |spec|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
spec.metadata['allowed_push_host'] = "https://rubygems.org"

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/PL-infrastructure-platform/gojira/tree/main'
spec.metadata['changelog_uri'] = 'https://github.com/PL-infrastructure-platform/gojira/tree/main'
spec.metadata['source_code_uri'] = 'https://github.com/kumar1202/gojira/tree/main'
spec.metadata['changelog_uri'] = 'https://github.com/kumar1202/gojira/tree/main'
else
raise 'RubyGems 2.0 or newer is required to protect against ' \
'public gem pushes.'
Expand Down

0 comments on commit 65765f1

Please sign in to comment.