Skip to content

Commit

Permalink
Bring the new release process (#1578)
Browse files Browse the repository at this point in the history
* Bring the new release process

* Use cucumber-wire 6.1.1
  • Loading branch information
aurelien-reeves authored Oct 12, 2021
1 parent f672e3d commit c3c907f
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 21 deletions.
21 changes: 21 additions & 0 deletions .github/actions/test-ruby/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run ruby tests

inputs:
ruby-version:
description: Version of ruby to use with ruby/setup-ruby@v1
required: false
default: '3.0'

runs:
using: "composite"

steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rake
shell: bash
23 changes: 5 additions & 18 deletions .github/workflows/cucumber-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Test cucumber

on:
Expand All @@ -22,25 +15,19 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.5, 2.6, 2.7, '3.0']
ruby: ['2.5', '2.6', '2.7', '3.0']
include:
- os: ubuntu-latest
ruby: jruby-9.2
exclude:
- ruby: 2.5
- ruby: '2.5'
os: windows-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
# uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0

- name: Run ruby tests
uses: ./.github/actions/test-ruby
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release RubyGems

on:
push:
branches:
- release/*

jobs:

pre-release-check:
name: Perform checks before releasing
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Check commit has been pushed on origin/main
run: |
git fetch --quiet origin main
git merge-base --is-ancestor HEAD origin/main
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby: ['2.5', '2.6', '2.7', '3.0']
include:
- os: ubuntu-latest
ruby: jruby-9.2
exclude:
- ruby: '2.5'
os: windows-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Run ruby tests
uses: ./.github/actions/test-ruby
with:
ruby-version: ${{ matrix.ruby }}

publish-rubygem:
name: Publish Ruby Gem
needs: [pre-release-check, tests]
runs-on: ubuntu-latest
environment: Release

steps:
- uses: actions/checkout@v2

- name: Publish ruby gem
uses: cucumber/action-publish-rubygem@v1.0.0
with:
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}

create-github-release:
name: Create GitHub Release and Git tag
needs: publish-rubygem
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write

steps:
- uses: actions/checkout@v2
- uses: cucumber/action-create-github-release@v1.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
if ENV['CUCUMBER_RUBY_WIRE']
gem 'cucumber-wire', path: ENV['CUCUMBER_RUBY_WIRE']
elsif !ENV['CUCUMBER_USE_RELEASED_GEMS']
gem 'cucumber-wire', github: 'cucumber/cucumber-ruby-wire', branch: 'main'
gem 'cucumber-wire', github: 'cucumber/cucumber-ruby-wire', tag: 'v6.1.1'
end

gem 'cucumber-expressions', path: ENV['CUCUMBER_EXPRESSIONS_RUBY'] if ENV['CUCUMBER_EXPRESSIONS_RUBY']
Expand Down
11 changes: 9 additions & 2 deletions docs/RELEASE_PROCESS.md → RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ To release `cucumber-ruby`, you'll need:
- make
- docker

# Release process for cucumber-wire

## Prerequisites

To release `cucumber`, you'll need to be a member of the core team

## cucumber-ruby-core and cucumber-ruby-wire

If internal libraries such as `cucumber-gherkin` needs to be updated, you'll
Expand All @@ -22,10 +28,11 @@ need to update and release `cucumber-ruby-core` first, then `cucumber-ruby-wire`
- Commit the changes using a verified signature
```shell
git commit --gpg-sign -am "Release X.Y.Z"
git push
```
- Now release it:
- Now release it: push to a dedicated `release/` branch:
```shell
make release
git push origin main:release/vX.Y.Z
```
- Check the release has been successfully pushed to [rubygems](https://rubygems.org/gems/cucumber)
- Finally, update the `cucumber-ruby` version in the
Expand Down

0 comments on commit c3c907f

Please sign in to comment.