mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 08:25:20 +08:00
release.yml: Fix tag conversion for Ruby 4.0
and PREVIOUS_RELEASE_TAG for any .0 releases
This commit is contained in:
1 parent
8fba4b0f60
commit
be43ad37b7
2 files changed
+17
-2
No files matched your search
@@ -49,9 +49,9 @@ jobs:
|
||||
|
||||
- name: Create a release on GitHub
|
||||
run: |
|
||||
RELEASE_TAG=$(echo v${{ env.RUBY_VERSION }} | sed 's/\./_/g')
|
||||
RELEASE_TAG=$(ruby tool/ruby-version.rb tag "${{ env.RUBY_VERSION }}")
|
||||
echo $RELEASE_TAG
|
||||
PREVIOUS_RELEASE_TAG=$(echo $RELEASE_TAG | awk 'BEGIN {FS="_"; OFS="_"}{ $NF=$NF-1; print }')
|
||||
PREVIOUS_RELEASE_TAG=$(ruby tool/ruby-version.rb previous-tag "${{ env.RUBY_VERSION }}")
|
||||
echo $PREVIOUS_RELEASE_TAG
|
||||
tool/gen-github-release.rb $PREVIOUS_RELEASE_TAG $RELEASE_TAG --no-dry-run
|
||||
env:
|
||||
|
||||
Regular → Executable
+15
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
module RubyVersion
|
||||
def self.tag(version)
|
||||
major_version = Integer(version.split('.', 2)[0])
|
||||
@@ -35,3 +37,16 @@ module RubyVersion
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
case ARGV[0]
|
||||
when "tag"
|
||||
print RubyVersion.tag(ARGV[1])
|
||||
when "previous"
|
||||
print RubyVersion.previous(ARGV[1])
|
||||
when "previous-tag"
|
||||
print RubyVersion.tag(RubyVersion.previous(ARGV[1]))
|
||||
else
|
||||
"#{$0}: unexpected command #{ARGV[0].inspect}"
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user