Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions .github/clean.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
require "fileutils"

ALLOW_LIST = [
".git",
".github",
".gitignore",
".npmignore",
".openapi-generator-ignore",
"CHANGELOG.md",
"LICENSE",
"MIGRATION.md",
"README.md",
"node_modules",
"openapi",
"openapitools.json",
"tmp"
].freeze
# Version-targeted deletion: Deletes specified version directory only
# All workflows must provide version directory parameter

::Dir.each_child(::Dir.pwd) do |source|
next if ALLOW_LIST.include?(source)
target_dir = ARGV[0]

# Preserve test-output directories for multi-version POC testing
next if source.start_with?("test-output-")
if target_dir.nil? || target_dir.empty?
raise "Error: Version directory parameter required. Usage: ruby clean.rb <version_dir>"
end

::FileUtils.rm_rf("#{::Dir.pwd}/#{source}")
# Delete only the specified directory
target_path = "#{::Dir.pwd}/#{target_dir}"
if ::File.exist?(target_path)
::FileUtils.rm_rf(target_path)
puts "Deleted: #{target_path}"
else
puts "Directory not found (will be created during generation): #{target_path}"
end
14 changes: 7 additions & 7 deletions .github/version.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
require "yaml"

# Support both single config and multi-version config approaches
# For multi-version POC, we can specify which config file to use
config_file = ARGV[1] || "openapi/config.yml"
# Default to config-v20111101 file if not provided for backwards compatibility
# This is because automated openapi repository dispatch currently only generates v20111101
config_file = ARGV[1] || "openapi/config-v20111101.yml"

config = ::YAML.load(::File.read(config_file))
major, minor, patch = config["npmVersion"].split(".")

# Note: "skip" logic is handled by workflow (version.rb not called when skip selected)
# Only minor and patch bumps are supported (major version locked to API version)
case ARGV[0]
when "major"
major = major.succ
minor = 0
patch = 0
when "minor"
minor = minor.succ
patch = 0
when "patch"
patch = patch.succ
else
raise "Invalid version bump type: #{ARGV[0]}. Supported: 'minor' or 'patch'"
end

config["npmVersion"] = "#{major}.#{minor}.#{patch}"
Expand Down
149 changes: 0 additions & 149 deletions .github/workflows/generate-multi-version.yml

This file was deleted.

Loading