From 3e33954d8ce45eb557f4b7fcf2c013bff1289836 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 22 Jun 2021 12:49:27 -0300 Subject: [PATCH] Create publish_to_rubygems.yml --- .github/workflows/publish_to_rubygems.yml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/publish_to_rubygems.yml diff --git a/.github/workflows/publish_to_rubygems.yml b/.github/workflows/publish_to_rubygems.yml new file mode 100644 index 0000000..055c70c --- /dev/null +++ b/.github/workflows/publish_to_rubygems.yml @@ -0,0 +1,30 @@ +name: Publish to Rubygems + +on: + release: + types: [created] + +jobs: + publish-to-rubygems: + 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}}"