Skip to content

ci: publish to RubyGems on GitHub release#8

Merged
peo-machine merged 1 commit intomainfrom
add-release-workflow
Apr 26, 2026
Merged

ci: publish to RubyGems on GitHub release#8
peo-machine merged 1 commit intomainfrom
add-release-workflow

Conversation

@peo-machine
Copy link
Copy Markdown
Collaborator

Summary

Adds `.github/workflows/release.yml` that auto-publishes to RubyGems when a GitHub release is published.

Trigger: `release: published`.

Steps:

  1. Verify release tag matches `Threencr::VERSION` in `lib/threencr/version.rb`. Mismatch fails before any publish.
  2. `bundle exec rake test` (smoke test).
  3. `gem build 3ncr.gemspec`.
  4. `gem push` using `GEM_HOST_API_KEY` from repo secrets.

Required secret: `RUBYGEMS_API_KEY` (will be set on the repo by the maintainer).

Future migration: RubyGems Trusted Publishing (OIDC) GA'd in 2024; switching removes the long-lived token. Tracked in PLAN.md §6d.

SHA-pinning matches the existing `test.yml` conventions (`actions/checkout`, `ruby/setup-ruby` SHAs).

Test plan

  • YAML parses cleanly
  • Version-extraction grep tested locally on current `lib/threencr/version.rb` (returns `1.0.0`)
  • Real test will be the next release — bump version, tag v1.0.1, click Publish release; workflow should publish or fail-loudly on tag mismatch

Triggered by 'release: published'. Verifies the tag matches
Threencr::VERSION, runs the test suite, builds the gem, then 'gem push'.
RUBYGEMS_API_KEY must be set as a repo secret.
@peo-machine peo-machine merged commit 4aef713 into main Apr 26, 2026
5 checks passed
@peo-machine peo-machine deleted the add-release-workflow branch April 26, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants