New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a RubyGems publishing workflow #273
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
https://andrewm.codes/blog/automating-ruby-gem-releases-with-github-actions/ |
Removed the old GitHub-only release workflow, since it wasn't doing anything useful. I'll look into a RubyGems publishing flow tonight. |
For reference: I just refactored another one of my gems' CI's, and this sufficed: on:
push:
tags:
- 'v*'
name: release
jobs:
create-release:
name: create GitHub release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}
rubygems:
name: publish to RubyGems
runs-on: ubuntu-latest
needs:
- create-release
steps:
- uses: actions/checkout@v4
- name: push to RubyGems
run: |
gem build lzfse.gemspec
gem push lzfse-*.gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} (Would need some small tweaks for ruby-macho, but the basic idea is the same.) |
I currently release new versions of the ruby-macho gem from my desktop. This isn't ideal, both security wise and in terms of availability for other Homebrew maintainers. So, we should use GitHub Actions to automatically publish releases instead.
Some notes:
gem push
can useGEM_HOST_API_KEY
in the environment to get a RubyGems API keyThe text was updated successfully, but these errors were encountered: