Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true

- run: bundle exec rspec spec

- run: bundle exec rubocop -P

- run: bundle exec rake build

- name: Publish gem to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: gem push pkg/*.gem

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: pkg/*.gem
generate_release_notes: true
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ $ bundle exec appraisal rake spec

```

## Releasing

Releases are created from git tags. After the version bump PR is merged into `master`, create and push a tag such as `v4.9.0`.

```sh
$ git checkout master
$ git pull --ff-only origin master
$ git tag v4.9.0
$ git push origin v4.9.0
```

Pushing the tag triggers `.github/workflows/release.yml`, which runs the base test suite, builds the gem, publishes it to RubyGems, and creates the matching GitHub Release. The workflow expects the repository secret `RUBYGEMS_API_KEY` to be configured.

## Contributing

## Versioning
Expand Down
Loading