From 4a9fe1004438076745dcb06664f594fa1a1542e4 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Sat, 21 May 2022 22:52:50 -0300 Subject: [PATCH] Automated CI for publish in Rubygems --- .github/workflows/rubygems.yml | 30 ++++++++++++++++++++++++++++++ erede.gemspec | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rubygems.yml diff --git a/.github/workflows/rubygems.yml b/.github/workflows/rubygems.yml new file mode 100644 index 0000000..f1de998 --- /dev/null +++ b/.github/workflows/rubygems.yml @@ -0,0 +1,30 @@ +name: Publish to Rubygems + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0 + + - name: Install dependencies + run: bundle install + + - 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}}" diff --git a/erede.gemspec b/erede.gemspec index 4ccd0eb..4bf611f 100644 --- a/erede.gemspec +++ b/erede.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'erede/version' Gem::Specification.new do |spec| - spec.name = 'erede' + spec.name = 'erede-ruby-sdk' spec.version = Erede::VERSION spec.authors = ['Rede'] spec.email = ['neto.joaobatista@gmail.com']