Skip to content

Commit 2ec3f1e

Browse files
author
Genevieve Nuebel
committed
Fix more no nos I found
1 parent 9802759 commit 2ec3f1e

5 files changed

Lines changed: 72 additions & 21 deletions

File tree

.github/workflows/openapi-generate-and-push.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
name: generated-${{ matrix.api_version }}
9292
path: ./${{ matrix.api_version }}
9393

94-
Commit-and-Push:
94+
Process-and-Push:
9595
runs-on: ubuntu-latest
9696
needs: [Setup, Generate]
9797
steps:
@@ -127,12 +127,12 @@ jobs:
127127
ruby .github/changelog_manager.rb "$VERSIONS_CSV"
128128
- name: Copy documentation
129129
run: |
130-
for dir in ./v20111101 ./v20250224; do
131-
if [ -d "$dir" ]; then
132-
cp LICENSE "$dir/LICENSE"
133-
cp CHANGELOG.md "$dir/CHANGELOG.md"
134-
cp MIGRATION.md "$dir/MIGRATION.md"
135-
fi
130+
GENERATED_VERSIONS="${{ steps.track_versions.outputs.generated_versions }}"
131+
132+
for VERSION in $GENERATED_VERSIONS; do
133+
cp LICENSE "./$VERSION/LICENSE"
134+
cp CHANGELOG.md "./$VERSION/CHANGELOG.md"
135+
cp MIGRATION.md "./$VERSION/MIGRATION.md"
136136
done
137137
- name: Checkout master
138138
run: git checkout master

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ on:
44
workflow_dispatch:
55
inputs:
66
version_directory:
7-
description: 'Version directory to publish from'
7+
description: 'API version directory to publish from'
88
required: true
9-
type: string
9+
type: choice
10+
options:
11+
- v20111101
12+
- v20250224
1013
workflow_call:
1114
inputs:
1215
version_directory:
13-
description: 'Version directory to publish from'
16+
description: 'API version directory to publish from'
1417
required: true
1518
type: string
1619

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ on:
44
workflow_dispatch:
55
inputs:
66
version_directory:
7-
description: 'Version directory to read version from'
7+
description: 'API version directory to release from'
88
required: true
9-
type: string
9+
type: choice
10+
options:
11+
- v20111101
12+
- v20250224
1013
workflow_call:
1114
inputs:
1215
version_directory:
13-
description: 'Version directory to read version from'
16+
description: 'API version directory to release from'
1417
required: true
1518
type: string
1619

docs/Adding-a-New-API-Version.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,56 @@ The `ConfigValidator` automatically validates that:
108108

109109
**No workflow changes needed** — the existing validation step in `generate.yml` calls `ConfigValidator` with your new version, and it automatically validates using the updated mapping.
110110

111-
### 2.2 Update openapi-generate-and-push.yml
111+
### 2.2 Update release.yml and publish.yml
112+
113+
Both the `release.yml` and `publish.yml` workflows use `workflow_dispatch` with choice inputs to allow manual triggering with the correct version directory.
114+
115+
#### 2.2a Update release.yml
116+
117+
**Location: Workflow dispatch options**
118+
119+
In the `on.workflow_dispatch.inputs.version_directory.options` section, add the new version to the dropdown list:
120+
121+
```yaml
122+
version_directory:
123+
description: 'API version directory'
124+
required: true
125+
type: choice
126+
options:
127+
- v20111101
128+
- v20250224
129+
- v20300101 # NEW
130+
```
131+
132+
#### 2.2b Update publish.yml
133+
134+
**Location: Workflow dispatch options**
135+
136+
In the `on.workflow_dispatch.inputs.version_directory.options` section, add the new version to the dropdown list:
137+
138+
```yaml
139+
version_directory:
140+
description: 'API version directory'
141+
required: true
142+
type: choice
143+
options:
144+
- v20111101
145+
- v20250224
146+
- v20300101 # NEW
147+
```
148+
149+
**Why both workflows need updating**: These choices allow users to manually trigger release and publish workflows for any version. Adding the new version ensures it can be selected in the GitHub Actions UI when manually triggering these workflows.
150+
151+
### 2.3 Update openapi-generate-and-push.yml
112152

113153
This workflow is automatically triggered by the OpenAPI repository to generate and push SDKs for all versions in parallel.
114154

115155
**Location 1: Version-to-config mapping**
116156

117-
In the `Setup` job's `Set up matrix` step, add an `elif` branch to map your new version to its config file:
157+
In the `Setup` job's `Set up matrix` step, find the section with the version-to-config mapping and add an `elif` branch for your new version:
118158

119159
```yaml
160+
# Map version to config file and major version
120161
if [ "$VERSION" = "v20111101" ]; then
121162
CONFIG="openapi/config-v20111101.yml"
122163
elif [ "$VERSION" = "v20250224" ]; then
@@ -126,7 +167,7 @@ elif [ "$VERSION" = "v20300101" ]; then
126167
fi
127168
```
128169

129-
This dynamically builds the matrix that determines which config file each version uses during generation.
170+
This dynamically builds the matrix JSON that determines which config file each version uses during generation.
130171

131172
**Location 2: Add version to ChangelogManager priority order**
132173

@@ -144,7 +185,7 @@ This ensures when multiple versions are generated, changelog entries appear in o
144185
- Extracts date ranges from existing entries
145186
- Inserts properly formatted entries at the top of the changelog
146187

147-
### 2.3 Update on-push-master.yml
188+
### 2.4 Update on-push-master.yml
148189

149190
This workflow automatically triggers publish and release jobs when version directories are pushed to master. Since individual version jobs use conditional `if` statements based on path changes, you need to add new conditional jobs for your new version.
150191

@@ -214,12 +255,14 @@ gate-v20250224-complete:
214255
- Gate jobs use the `always()` condition so they run even when intermediate jobs are skipped
215256
- This prevents npm registry race conditions and ensures correct behavior whether one or multiple versions are modified
216257

217-
### 2.4 Verify Workflow Syntax
258+
### 2.5 Verify Workflow Syntax
218259

219-
Check that your YAML is valid for all three modified files:
260+
Check that your YAML is valid for all four modified files:
220261

221262
```bash
222263
ruby -e "require 'yaml'; puts YAML.load(File.read('.github/workflows/generate.yml'))"
264+
ruby -e "require 'yaml'; puts YAML.load(File.read('.github/workflows/release.yml'))"
265+
ruby -e "require 'yaml'; puts YAML.load(File.read('.github/workflows/publish.yml'))"
223266
ruby -e "require 'yaml'; puts YAML.load(File.read('.github/workflows/openapi-generate-and-push.yml'))"
224267
ruby -e "require 'yaml'; puts YAML.load(File.read('.github/workflows/on-push-master.yml'))"
225268
```
@@ -386,13 +429,15 @@ Use this checklist to verify you've completed all steps:
386429
- [ ] Major version in config is unique and sequential (4.0.0 for v20300101)
387430
- [ ] Updated `.github/workflows/generate.yml` with new version in dropdown options
388431
- [ ] Updated `.github/config_validator.rb` with new version in `SUPPORTED_VERSIONS` mapping
432+
- [ ] Updated `.github/workflows/release.yml` with new version in dropdown options
433+
- [ ] Updated `.github/workflows/publish.yml` with new version in dropdown options
389434
- [ ] Updated `.github/workflows/openapi-generate-and-push.yml` with version-to-config mapping in Setup job
390435
- [ ] Updated `.github/changelog_manager.rb` with new version in `API_VERSION_ORDER` array
391436
- [ ] Updated `.github/workflows/on-push-master.yml` path triggers with `v20300101/**`
392437
- [ ] Updated `.github/workflows/on-push-master.yml` with new publish job for v20300101
393438
- [ ] Updated `.github/workflows/on-push-master.yml` with new release job for v20300101
394439
- [ ] Updated `.github/workflows/on-push-master.yml` with new gate job for previous version (v20250224)
395-
- [ ] Verified workflow YAML syntax is valid for all three modified files
440+
- [ ] Verified workflow YAML syntax is valid for all five modified files
396441
- [ ] Updated root `README.md` with new API version table entry
397442
- [ ] Updated root `README.md` with installation example for new version
398443
- [ ] Updated `MIGRATION.md` with new migration section

docs/Workflow-and-Configuration-Reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ strategy:
129129
130130
#### Step 5: Automatic Publish and Release (via on-push-master.yml)
131131
132-
**Architecture**: After `Commit-and-Push` completes and pushes to master, the automatic `on-push-master.yml` workflow is triggered by GitHub's push event.
132+
**Architecture**: After `Process-and-Push` completes and pushes to master, the automatic `on-push-master.yml` workflow is triggered by GitHub's push event.
133133
134134
**Why This Architecture?**
135135
- Separates concerns: `openapi-generate-and-push.yml` owns generation, `on-push-master.yml` owns publishing

0 commit comments

Comments
 (0)