Skip to content
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release gem on RubyGems.org and create GitHub release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release_gem:
name: Release gem on RubyGems.org
if: github.repository == 'Shopify/graphql-metrics'
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

environment: release

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Ruby
uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
with:
bundler-cache: true

- name: Release gem on RubyGems.org
uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1

release_github:
name: Create GitHub release
if: github.repository == 'Shopify/graphql-metrics'
needs: release_gem
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Create GitHub release
run: gh release create "${GITHUB_REF_NAME}" --verify-tag --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 11 additions & 11 deletions RELEASING
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Releasing graphql-metrics

1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
2. Update VERSION in lib/graphql/metrics/version.rb
3. Add a CHANGELOG entry for the new release
4. Commit the changes with a commit message like "Packaging for release X.Y.Z"
5. Tag the release with the version (Leave REV blank for HEAD or provide a SHA)
$ git tag vX.Y.Z REV
6. Push out the changes
$ git push
7. Push out the tags
$ git push --tags
8. Publish the gem
$ gem build graphql_metrics.gemspec
$ gem push graphql-metrics-X.Y.Z.gem
3. Run `bundle install` so Gemfile.lock picks up the new version
4. Add a CHANGELOG entry for the new release
5. Open a pull request with a title like "Packaging for release X.Y.Z" and merge it
6. Tag the merge commit on main with the version and push the tag
$ git checkout main && git pull
$ git tag vX.Y.Z
$ git push origin vX.Y.Z

Pushing the tag runs the Release workflow (.github/workflows/release.yml),
which publishes the gem to RubyGems.org with trusted publishing and creates
a GitHub release with generated notes. No RubyGems API key is needed.
Loading