From f2d76246be3aa7e2f1657df919bc86d3155ab038 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Tue, 5 Mar 2024 15:49:54 -0500 Subject: [PATCH] ci: Add gem release workflow (#27) --- .github/workflows/release-gem.yml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/release-gem.yml diff --git a/.github/workflows/release-gem.yml b/.github/workflows/release-gem.yml new file mode 100644 index 0000000..71542d0 --- /dev/null +++ b/.github/workflows/release-gem.yml @@ -0,0 +1,37 @@ +on: + push: + branches: main + +jobs: + code_quality: + uses: ./.github/workflows/main.yml + release-gem: + runs-on: ubuntu-latest + needs: code_quality + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: '0' + ref: ${{github.head_ref}} + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + - name: Setup + run: | + git config user.email "maxveldink@gmail.com" + git config user.name "Max VelDink" + 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 + env: + GEM_HOST_API_KEY: "${{secrets.RUBY_GEMS_PUSH_API_KEY}}" + - name: Install + run: gem install gemsmith + - name: Publish + run: gemsmith --publish