ruby-macho
ruby-macho copied to clipboard
Add a RubyGems publishing workflow
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:
- It looks like
gem push
can useGEM_HOST_API_KEY
in the environment to get a RubyGems API key
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/ This article might be useful for you if you want to combine the release updating and gem publishing steps into one workflow.
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.)