Skip to content

Commit 4754b89

Browse files
suchintanclaude
andauthored
ci: reconcile release workflows with the development repository (#219)
The release workflows here and in the development repository are maintained by hand and had drifted in both directions. Releases are cut from tags on this repository, so these are the copies that actually run. This applies the union of both sides' fixes to the three files that differed: - **release-gem.yml** — compare versions as parsed `Gem::Version` values. RubyGems rewrites a SemVer prerelease (`0.3.0-beta.1` becomes `0.3.0.pre.beta.1`), so the current raw-string comparison would abort the next prerelease gem release with a false "versions do not match". - **release-maven.yml** — newer pinned `actions/setup-java` (v5.6.0). - **release-nuget.yml** — spacing normalization only. The matching change on the development side has already merged, leaving the shared workflow files byte-identical in both repositories. `release-npm.yml` and `release-pypi.yml` already matched. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: suchintan <3853670+suchintan@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent a1f367f commit 4754b89

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/release-gem.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,31 @@ jobs:
4242
gemspec = Gem::Specification.load('ruby/rustwright.gemspec')
4343
abort 'Unable to load ruby/rustwright.gemspec' unless gemspec
4444
45+
# RubyGems rewrites a SemVer prerelease when it parses it, so a
46+
# Cargo.toml version of "0.3.0-beta.1" reaches the gemspec as
47+
# "0.3.0.pre.beta.1". Those raw strings can never match, so compare
48+
# parsed Gem::Version values here.
4549
versions = {
46-
'Cargo.toml' => cargo_version,
47-
'ruby/rustwright.gemspec' => gemspec.version.to_s
50+
'Cargo.toml' => Gem::Version.new(cargo_version),
51+
'ruby/rustwright.gemspec' => gemspec.version
4852
}
4953
expected = versions.values.first
50-
abort "Package versions do not match: #{versions}" unless versions.values.all? { |value| value == expected }
54+
unless versions.values.all? { |value| value == expected }
55+
abort "Package versions do not match: #{versions.transform_values(&:to_s)}"
56+
end
5157
58+
# The tag is compared literally, not as a Gem::Version. Parsed
59+
# equality also accepts "0.2" for "0.2.0" and "0.3.0-rc1" for
60+
# "0.3.0-rc.1", and the other four workflows compare tag strings
61+
# exactly. A looser check here would let one tag publish the gem
62+
# while every other registry rejected it.
5263
if ENV['GITHUB_REF_TYPE'] == 'tag'
5364
tag_version = ENV.fetch('GITHUB_REF_NAME').sub(/^v/, '')
54-
abort "Tag version #{tag_version.inspect} does not match package version #{expected.inspect}" unless tag_version == expected
65+
unless tag_version == cargo_version
66+
abort "Tag version #{tag_version.inspect} does not match package version #{cargo_version.inspect}"
67+
end
5568
end
56-
puts "Validated package version #{expected}"
69+
puts "Validated package version #{cargo_version}"
5770
RUBY
5871
5972
native:
@@ -228,7 +241,6 @@ jobs:
228241
name: gem-package
229242
path: gem-dist
230243

231-
232244
- name: Publish experimental platform gems
233245
shell: bash
234246
run: |

.github/workflows/release-maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
183183

184184
- name: Set up JDK
185-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
185+
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
186186
with:
187187
distribution: temurin
188188
java-version: "23"
@@ -235,7 +235,7 @@ jobs:
235235
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
236236

237237
- name: Set up JDK
238-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
238+
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
239239
with:
240240
distribution: temurin
241241
java-version: "23"

.github/workflows/release-nuget.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ jobs:
256256
name: nuget-package
257257
path: nuget-dist
258258

259-
260259
- name: NuGet login (Trusted Publishing)
261260
id: nuget_login
262261
uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0

0 commit comments

Comments
 (0)