Skip to content

Commit c3c907f

Browse files
Bring the new release process (#1578)
* Bring the new release process * Use cucumber-wire 6.1.1
1 parent f672e3d commit c3c907f

File tree

5 files changed

+105
-21
lines changed

5 files changed

+105
-21
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Run ruby tests
2+
3+
inputs:
4+
ruby-version:
5+
description: Version of ruby to use with ruby/setup-ruby@v1
6+
required: false
7+
default: '3.0'
8+
9+
runs:
10+
using: "composite"
11+
12+
steps:
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ${{ matrix.ruby }}
17+
bundler-cache: true
18+
19+
- name: Run tests
20+
run: bundle exec rake
21+
shell: bash
Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7-
81
name: Test cucumber
92

103
on:
@@ -22,25 +15,19 @@ jobs:
2215
strategy:
2316
matrix:
2417
os: [ubuntu-latest, macos-latest, windows-latest]
25-
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
26-
ruby: [2.5, 2.6, 2.7, '3.0']
18+
ruby: ['2.5', '2.6', '2.7', '3.0']
2719
include:
2820
- os: ubuntu-latest
2921
ruby: jruby-9.2
3022
exclude:
31-
- ruby: 2.5
23+
- ruby: '2.5'
3224
os: windows-latest
3325

3426
runs-on: ${{ matrix.os }}
3527
steps:
3628
- uses: actions/checkout@v2
37-
- name: Set up Ruby
38-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
39-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
40-
uses: ruby/setup-ruby@v1
41-
# uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
29+
30+
- name: Run ruby tests
31+
uses: ./.github/actions/test-ruby
4232
with:
4333
ruby-version: ${{ matrix.ruby }}
44-
bundler-cache: true
45-
- name: Run tests
46-
run: bundle exec rake

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release RubyGems
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*
7+
8+
jobs:
9+
10+
pre-release-check:
11+
name: Perform checks before releasing
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Check commit has been pushed on origin/main
18+
run: |
19+
git fetch --quiet origin main
20+
git merge-base --is-ancestor HEAD origin/main
21+
22+
tests:
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
ruby: ['2.5', '2.6', '2.7', '3.0']
27+
include:
28+
- os: ubuntu-latest
29+
ruby: jruby-9.2
30+
exclude:
31+
- ruby: '2.5'
32+
os: windows-latest
33+
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
- name: Run ruby tests
39+
uses: ./.github/actions/test-ruby
40+
with:
41+
ruby-version: ${{ matrix.ruby }}
42+
43+
publish-rubygem:
44+
name: Publish Ruby Gem
45+
needs: [pre-release-check, tests]
46+
runs-on: ubuntu-latest
47+
environment: Release
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Publish ruby gem
53+
uses: cucumber/[email protected]
54+
with:
55+
rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
56+
57+
create-github-release:
58+
name: Create GitHub Release and Git tag
59+
needs: publish-rubygem
60+
runs-on: ubuntu-latest
61+
environment: Release
62+
permissions:
63+
contents: write
64+
65+
steps:
66+
- uses: actions/checkout@v2
67+
- uses: cucumber/[email protected]
68+
with:
69+
github-token: ${{ secrets.GITHUB_TOKEN }}

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313
if ENV['CUCUMBER_RUBY_WIRE']
1414
gem 'cucumber-wire', path: ENV['CUCUMBER_RUBY_WIRE']
1515
elsif !ENV['CUCUMBER_USE_RELEASED_GEMS']
16-
gem 'cucumber-wire', github: 'cucumber/cucumber-ruby-wire', branch: 'main'
16+
gem 'cucumber-wire', github: 'cucumber/cucumber-ruby-wire', tag: 'v6.1.1'
1717
end
1818

1919
gem 'cucumber-expressions', path: ENV['CUCUMBER_EXPRESSIONS_RUBY'] if ENV['CUCUMBER_EXPRESSIONS_RUBY']

docs/RELEASE_PROCESS.md renamed to RELEASING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ To release `cucumber-ruby`, you'll need:
88
- make
99
- docker
1010

11+
# Release process for cucumber-wire
12+
13+
## Prerequisites
14+
15+
To release `cucumber`, you'll need to be a member of the core team
16+
1117
## cucumber-ruby-core and cucumber-ruby-wire
1218

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

0 commit comments

Comments
 (0)