Skip to content

Commit 6cdcf7d

Browse files
committed
chore: Upgrade release system to the toys-release gem
1 parent 070056c commit 6cdcf7d

File tree

9 files changed

+56
-66
lines changed

9 files changed

+56
-66
lines changed

.github/workflows/release-hook-on-closed.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
issues: write # required to create issues for failed releases
1616
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
1717
env:
18-
RUBY_VERSION: "3.2"
18+
RUBY_VERSION: "4.0"
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -25,13 +25,12 @@ jobs:
2525
- name: Checkout repo
2626
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2727
- name: Install Toys
28-
run: "gem install --no-document toys -v 0.15.5"
28+
run: "gem install --no-document toys -v 0.19.1"
2929
- name: Process release request
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
3233
run: |
3334
toys release _onclosed --verbose \
34-
"--enable-releases=${{ secrets.ENABLE_RELEASES }}" \
3535
"--event-path=${{ github.event_path }}" \
36-
"--rubygems-api-key=${{ secrets.RUBYGEMS_API_KEY }}" \
3736
< /dev/null

.github/workflows/release-hook-on-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write # required for updating release PRs
1616
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
1717
env:
18-
RUBY_VERSION: "3.2"
18+
RUBY_VERSION: "4.0"
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -25,7 +25,7 @@ jobs:
2525
- name: Checkout repo
2626
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2727
- name: Install Toys
28-
run: "gem install --no-document toys -v 0.15.5"
28+
run: "gem install --no-document toys -v 0.19.1"
2929
- name: Update open releases
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-perform.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Force release
33
on:
44
workflow_dispatch:
55
inputs:
6-
gem:
7-
description: Gem to release
6+
name:
7+
description: Component to release
88
required: true
99
version:
1010
description: Version to release
@@ -21,10 +21,11 @@ jobs:
2121
release-perform:
2222
permissions:
2323
contents: write # required for creating releases
24-
pull-requests: write # required for creating release PRs
24+
pull-requests: write # required for updating label on PR, posting comments
25+
issues: write # required for creating new issues on failed releases
2526
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
2627
env:
27-
RUBY_VERSION: "3.2"
28+
RUBY_VERSION: "4.0"
2829
runs-on: ubuntu-latest
2930
steps:
3031
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -34,15 +35,14 @@ jobs:
3435
- name: Checkout repo
3536
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3637
- name: Install Toys
37-
run: "gem install --no-document toys -v 0.15.5"
38+
run: "gem install --no-document toys -v 0.19.1"
3839
- name: Perform release
3940
env:
4041
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
4143
run: |
4244
toys release perform --yes --verbose \
43-
"--enable-releases=${{ secrets.ENABLE_RELEASES }}" \
44-
"--release-sha=${{ github.sha }}" \
45-
"--rubygems-api-key=${{ secrets.RUBYGEMS_API_KEY }}" \
45+
"--release-ref=${{ github.sha }}" \
4646
${{ github.event.inputs.flags }} \
47-
"${{ github.event.inputs.gem }}" "${{ github.event.inputs.version }}" \
47+
"${{ github.event.inputs.name }}" "${{ github.event.inputs.version }}" \
4848
< /dev/null

.github/workflows/release-request-weekly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write # required for creating release PRs
1515
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
1616
env:
17-
RUBY_VERSION: "3.2"
17+
RUBY_VERSION: "4.0"
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2727

2828
- name: Install Toys
29-
run: "gem install --no-document toys -v 0.15.5"
29+
run: "gem install --no-document toys -v 0.19.1"
3030

3131
- name: Create otelbot app token
3232
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
@@ -41,5 +41,5 @@ jobs:
4141
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4242
run: |
4343
toys release request --yes --verbose \
44-
"--release-ref=${{ github.ref }}" \
44+
"--target-branch=${{ github.ref }}" \
4545
< /dev/null

.github/workflows/release-request.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Open release request
33
on:
44
workflow_dispatch:
55
inputs:
6-
gems:
7-
description: Gems to release (leave blank to release all gems)
6+
names:
7+
description: Components to release (leave blank to release all components)
88
required: false
99
default: ""
1010

@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write # required for creating release PRs
1919
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
2020
env:
21-
RUBY_VERSION: "3.2"
21+
RUBY_VERSION: "4.0"
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3131

3232
- name: Install Toys
33-
run: "gem install --no-document toys -v 0.15.5"
33+
run: "gem install --no-document toys -v 0.19.1"
3434

3535
- name: Create otelbot app token
3636
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
@@ -44,6 +44,6 @@ jobs:
4444
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4545
run: |
4646
toys release request --yes --verbose \
47-
"--gems=${{ github.event.inputs.gems }}" \
48-
"--release-ref=${{ github.ref }}" \
47+
"--target-branch=${{ github.ref }}" \
48+
${{ github.event.inputs.names }} \
4949
< /dev/null

.github/workflows/release-retry.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ jobs:
1818
release-retry:
1919
permissions:
2020
contents: write # required for creating releases
21-
pull-requests: write # required for creating release PRs
21+
pull-requests: write # required for updating label on PR, posting comments
22+
issues: write # required for creating new issues on failed releases
2223
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
2324
env:
24-
RUBY_VERSION: "3.2"
25+
RUBY_VERSION: "4.0"
2526
runs-on: ubuntu-latest
2627
steps:
2728
- name: Install Ruby ${{ env.RUBY_VERSION }}
@@ -33,15 +34,14 @@ jobs:
3334
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3435

3536
- name: Install Toys
36-
run: "gem install --no-document toys -v 0.15.5"
37+
run: "gem install --no-document toys -v 0.19.1"
3738

3839
- name: Retry release
3940
env:
4041
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
4143
run: |
4244
toys release retry --yes --verbose \
43-
"--enable-releases=${{ secrets.ENABLE_RELEASES }}" \
44-
"--rubygems-api-key=${{ secrets.RUBYGEMS_API_KEY }}" \
4545
${{ github.event.inputs.flags }} \
4646
"${{ github.event.inputs.release_pr }}" \
4747
< /dev/null

.toys/.data/releases.yml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1-
# This file controls the release system.
1+
# This file controls the toys-release gem.
22

33
# The repo organization and name.
44
repo: open-telemetry/opentelemetry-ruby-contrib
5-
# The main branch name. Releases must happen on this branch.
6-
main_branch: main
5+
76
# Time in seconds for release scripts to wait for CI to complete.
87
required_checks_timeout: 1200
8+
9+
# Regex matching which GitHub checks are required to pass before a release
10+
# can occur.
911
required_checks: "^(ci|CI).*"
12+
1013
# Git user attached to commits for release pull requests.
1114
git_user_name: otelbot
1215
git_user_email: [email protected]
1316

14-
# Control the conventional commit linter.
15-
commit_lint:
16-
# Whether conventional commit errors should cause a GitHub check fail.
17-
fail_checks: true
18-
# Merge types allowed by the repo.
19-
merge: squash
20-
21-
# List of all releasable gems. Each gem should include:
17+
# List of all releaseable gems. Each gem should include:
2218
# * name: The name of the gem. (Required.)
23-
# * directory: Gem directory relative to the repo root. (Required.)
19+
# * directory: Gem directory relative to the repo root.
20+
# (Required unless the gem name matches the directory name exactly. This
21+
# means it's always required in this repo because every gem directory is in
22+
# a subdirectory of "instrumentation", "helpers", "propagator", etc..)
2423
# * version_rb_path: Path to version.rb relative to the gem directory.
2524
# (Required only if it does not match the gem name. e.g. The gem
26-
# "opentelemetry-sdk" would default to lib/opentelemetry/sdk/version.rb)
25+
# "opentelemetry-helpers-sql" would default to
26+
# "lib/opentelemetry/helpers/sql/version.rb", so this field is required
27+
# only if the actual path is different.)
2728
# * version_constant: The fully-qualified version constant as an array.
28-
# (Required because the OpenTelemetry namespace does not match the gem
29-
# name "opentelemetry".)
30-
# * changelog_path: Path to CHANGELOG.md relative to the gem directory.
31-
# (Required only if it is not in the expected location.)
29+
# (Required if the actual constant name, including its capitalization,
30+
# differs from what would be inferred from the gem name. This means it's
31+
# always required in this repo, because the capitalization of the
32+
# "OpenTelemetry" namespace does not match the gem name "opentelemetry".)
33+
# * changelog_path: Path to the changelog relative to the gem directory.
34+
# (Required only if it is not in the expected location, which is the file
35+
# "CHANGELOG.md" at the root of the gem directory.)
3236
gems:
3337
- name: opentelemetry-instrumentation-factory_bot
3438
directory: instrumentation/factory_bot
@@ -43,11 +47,7 @@ gems:
4347
version_constant: [OpenTelemetry, Instrumentation, ActiveStorage, VERSION]
4448

4549
- name: opentelemetry-helpers-sql
46-
# we append a slash here to avoid the naive substring start_with? directory-matching condition in underlying toys gem
47-
# which causes helpers/sql to incorrectly match when changes occur in helpers/sql-processor or helpers/sql-obfuscation
48-
# https://github.com/dazuma/toys/blob/17ed449da8299f272b834470ff6b279a59e8070b/.toys/release/.lib/release_utils.rb#L436
49-
# https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1727
50-
directory: helpers/sql/
50+
directory: helpers/sql
5151
version_constant: [OpenTelemetry, Helpers, Sql, VERSION]
5252

5353
- name: opentelemetry-instrumentation-gruf
@@ -141,11 +141,7 @@ gems:
141141
version_constant: [OpenTelemetry, Instrumentation, LMDB, VERSION]
142142

143143
- name: opentelemetry-instrumentation-http
144-
# we append a slash here to avoid the naive substring start_with? directory-matching condition in underlying toys gem
145-
# which causes instrumentation/http to incorrectly match when changes occur in instrumentation/httpx
146-
# https://github.com/dazuma/toys/blob/17ed449da8299f272b834470ff6b279a59e8070b/.toys/release/.lib/release_utils.rb#L436
147-
# https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/1512
148-
directory: instrumentation/http/
144+
directory: instrumentation/http
149145
version_constant: [OpenTelemetry, Instrumentation, HTTP, VERSION]
150146

151147
- name: opentelemetry-instrumentation-graphql
@@ -275,22 +271,18 @@ gems:
275271

276272
- name: opentelemetry-resource-detector-aws
277273
directory: resources/aws
278-
version_rb_path: lib/opentelemetry/resource/detector/aws/version.rb
279274
version_constant: [OpenTelemetry, Resource, Detector, AWS, VERSION]
280275

281276
- name: opentelemetry-resource-detector-azure
282277
directory: resources/azure
283-
version_rb_path: lib/opentelemetry/resource/detector/azure/version.rb
284278
version_constant: [OpenTelemetry, Resource, Detector, Azure, VERSION]
285279

286280
- name: opentelemetry-resource-detector-container
287281
directory: resources/container
288-
version_rb_path: lib/opentelemetry/resource/detector/container/version.rb
289282
version_constant: [OpenTelemetry, Resource, Detector, Container, VERSION]
290283

291284
- name: opentelemetry-resource-detector-google_cloud_platform
292285
directory: resources/google_cloud_platform
293-
version_rb_path: lib/opentelemetry/resource/detector/google_cloud_platform/version.rb
294286
version_constant: [OpenTelemetry, Resource, Detector, GoogleCloudPlatform, VERSION]
295287

296288
- name: opentelemetry-sampler-xray

.toys/.toys.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
toys_version! ">= 0.15.5"
1+
# frozen_string_literal: true
22

3-
load_git remote: "https://github.com/dazuma/toys.git",
4-
path: ".toys/release",
5-
as: "release",
6-
commit: "common-tools/v0.15.5.1",
7-
update: 3600
3+
toys_version! ">= 0.19"

.toys/release.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# frozen_string_literal: true
2+
3+
load_gem "toys-release", "= 0.4.0"

0 commit comments

Comments
 (0)