Skip to content

Commit 0cc19c6

Browse files
GvieveGenevieve Nuebel
andauthored
Final Multi-Version SDK Support Implementation (#71) [skip-publish]
* Update config files for multi version handling * Create Flow document for reference * Update clean script to delete version directory only with arg * Update version script to remove major and raise error if invalid version * Add version directory variable to publish/release * Update on push to do matrix style versioned publish/release, skip-publish flag * Generate to validate bump version, skip bump, matrix for multi version, update changelog * Update automation to accept new variables, matrix for multi version, update changelog * Update all the md docs and templates accordingly * Create all the docs....soooo many docs * Migrate SDK from latest/ to v20111101/ [skip-publish] --------- Co-authored-by: Genevieve Nuebel <genevieve.nuebel@mx.com>
1 parent f49b116 commit 0cc19c6

40 files changed

Lines changed: 2441 additions & 508 deletions

.github/clean.rb

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
require "fileutils"
22

3-
ALLOW_LIST = [
4-
".git",
5-
".github",
6-
".gitignore",
7-
".npmignore",
8-
".openapi-generator-ignore",
9-
"CHANGELOG.md",
10-
"LICENSE",
11-
"MIGRATION.md",
12-
"README.md",
13-
"node_modules",
14-
"openapi",
15-
"openapitools.json",
16-
"tmp"
17-
].freeze
3+
# Version-targeted deletion: Deletes specified version directory only
4+
# All workflows must provide version directory parameter
185

19-
::Dir.each_child(::Dir.pwd) do |source|
20-
next if ALLOW_LIST.include?(source)
6+
target_dir = ARGV[0]
217

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

25-
::FileUtils.rm_rf("#{::Dir.pwd}/#{source}")
12+
# Delete only the specified directory
13+
target_path = "#{::Dir.pwd}/#{target_dir}"
14+
if ::File.exist?(target_path)
15+
::FileUtils.rm_rf(target_path)
16+
puts "Deleted: #{target_path}"
17+
else
18+
puts "Directory not found (will be created during generation): #{target_path}"
2619
end

.github/version.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
require "yaml"
22

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

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

10+
# Note: "skip" logic is handled by workflow (version.rb not called when skip selected)
11+
# Only minor and patch bumps are supported (major version locked to API version)
1012
case ARGV[0]
11-
when "major"
12-
major = major.succ
13-
minor = 0
14-
patch = 0
1513
when "minor"
1614
minor = minor.succ
1715
patch = 0
1816
when "patch"
1917
patch = patch.succ
18+
else
19+
raise "Invalid version bump type: #{ARGV[0]}. Supported: 'minor' or 'patch'"
2020
end
2121

2222
config["npmVersion"] = "#{major}.#{minor}.#{patch}"

.github/workflows/generate-multi-version.yml

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)