From 89d6bbdf6e96be65c6617e2dcc916a4dc14c977d Mon Sep 17 00:00:00 2001 From: Wolfgang Wedelich-John Date: Fri, 30 Jul 2021 14:58:59 +0200 Subject: [PATCH] Added action to publish to rubygems --- .github/workflows/rubygem.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/rubygem.yml diff --git a/.github/workflows/rubygem.yml b/.github/workflows/rubygem.yml new file mode 100644 index 0000000..028db84 --- /dev/null +++ b/.github/workflows/rubygem.yml @@ -0,0 +1,37 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Ruby Gem + +on: + # Manually publish + workflow_dispatch: + +jobs: + build: + name: Build + Publish + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + - run: bundle install + - name: Publish to RubyGems + env: + GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" + 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 +