Skip to content

Commit

Permalink
Attempt to fix the rubygems push
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu committed Apr 18, 2023
1 parent a3d3d80 commit 17da402
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
name: Publish Gem

on:
workflow_dispatch:
push:
tags:
- "v*"

env:
RUBY_VERSION: 2.7.6

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest

permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- name: Release Gem
if: contains(github.ref, 'refs/tags/v')
uses: cadwallion/publish-rubygems-action@master
- 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
bundle install > /dev/null
rake release
gem build *.gemspec
# gem push *.gem
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
RELEASE_COMMAND: rake release
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}

0 comments on commit 17da402

Please sign in to comment.