Skip to content

Commit 46a1d71

Browse files
committed
(ci) prepare release 1.5.0
1 parent 7876c26 commit 46a1d71

2 files changed

Lines changed: 47 additions & 15 deletions

File tree

docs/CLI.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This document contains the help content for the `sideko` command-line program.
2525
* [`sideko sdk config sync`](#sideko-sdk-config-sync)
2626
* [`sideko sdk create`](#sideko-sdk-create)
2727
* [`sideko sdk update`](#sideko-sdk-update)
28+
* [`sideko sdk released`](#sideko-sdk-released)
2829
* [`sideko doc`](#sideko-doc)
2930
* [`sideko doc list`](#sideko-doc-list)
3031
* [`sideko doc deploy`](#sideko-doc-deploy)
@@ -113,12 +114,14 @@ manage api specification versions
113114

114115
create a new version of an api with an openapi spec
115116

116-
**Usage:** `sideko api version create [OPTIONS] --name <NAME> --version <VERSION> --spec <SPEC>`
117+
**Usage:** `sideko api version create [OPTIONS] --name <NAME> --spec <SPEC>`
117118

118119
###### **Options:**
119120

120121
* `--name <NAME>` — api name or id e.g. my-api
121-
* `--version <VERSION>` — semantic version (e.g. `2.1.5`) or version bump (`patch`, `minor`, `major`, `rc`)
122+
* `--version <VERSION>` — semantic version (e.g. `2.1.5`) or version bump (`auto`, `patch`, `minor`, `major`, `rc-patch`, `rc-minor`, `rc-major`, `release`)
123+
124+
Default value: `auto`
122125
* `--spec <SPEC>` — path to openapi specification (YAML or JSON format)
123126
* `--allow-lint-errors` — Allow linting errors to be present in the provided spec [default: false]
124127

@@ -156,12 +159,14 @@ list api versions
156159

157160
updates an existing api version
158161

159-
**Usage:** `sideko api version update [OPTIONS] --name <NAME> --version <VERSION>`
162+
**Usage:** `sideko api version update [OPTIONS] --name <NAME>`
160163

161164
###### **Options:**
162165

163166
* `--name <NAME>` — api name or id e.g. my-api
164167
* `--version <VERSION>` — version to update (e.g. `2.1.5` or `latest`)
168+
169+
Default value: `latest`
165170
* `--new-version <NEW_VERSION>` — version to update with (e.g. `2.1.5`)
166171
* `--spec <SPEC>` — path to openapi spec (yaml or json format) to update with
167172
* `--allow-lint-errors` — Allow linting errors to be present in the provided spec [default: false]
@@ -184,12 +189,14 @@ updates an existing api version
184189

185190
downloads the openapi specification of an api version
186191

187-
**Usage:** `sideko api version download [OPTIONS] --name <NAME> --version <VERSION>`
192+
**Usage:** `sideko api version download [OPTIONS] --name <NAME>`
188193

189194
###### **Options:**
190195

191196
* `--name <NAME>` — api name or id e.g. my-api
192197
* `--version <VERSION>` — version to update (e.g. `2.1.5` or `latest`)
198+
199+
Default value: `latest`
193200
* `--output <OUTPUT>` — custom output path of sdk config (must be .yaml or .yml or .json) the command may alter the extension according to the format of the downloaded OpenAPI file
194201

195202

@@ -198,12 +205,14 @@ downloads the openapi specification of an api version
198205

199206
create a new api
200207

201-
**Usage:** `sideko api create [OPTIONS] --name <NAME> --version <VERSION> --spec <SPEC>`
208+
**Usage:** `sideko api create [OPTIONS] --name <NAME> --spec <SPEC>`
202209

203210
###### **Options:**
204211

205212
* `--name <NAME>` — name of api (only alphanumeric characters and dashes, e.g. `my-api`)
206213
* `--version <VERSION>` — semantic version of initial version (e.g. `0.1.0`)
214+
215+
Default value: `0.1.0`
207216
* `--spec <SPEC>` — path to openapi spec of initial version (yaml or json format)
208217
* `--allow-lint-errors` — Allow linting errors to be present in the provided spec [default: false]
209218

@@ -312,6 +321,7 @@ generate, customize, and sync sdks
312321
* `config` — manage sdk configs
313322
* `create` — create an sdk using an existing sdk config
314323
* `update` — update sdk to implement changes to apis
324+
* `released` — mark an sdk as released
315325

316326

317327

@@ -406,20 +416,37 @@ create an sdk using an existing sdk config
406416

407417
update sdk to implement changes to apis
408418

409-
**Usage:** `sideko sdk update [OPTIONS] --config <CONFIG> --repo <REPO> --version <VERSION>`
419+
**Usage:** `sideko sdk update [OPTIONS] --config <CONFIG> --repo <REPO>`
410420

411421
###### **Options:**
412422

413423
* `--config <CONFIG>` — path to sdk config
414424
* `--repo <REPO>` — path to root of sdk repo
415-
* `--version <VERSION>` — semantic version of generated sdk (e.g. `2.1.5`) or version bump (`patch`, `minor`, `major`, `rc`)
425+
* `--version <VERSION>` — semantic version (e.g. `2.1.5`) or version bump (`auto`, `patch`, `minor`, `major`, `rc-patch`, `rc-minor`, `rc-major`, `release`)
426+
427+
Default value: `auto`
416428
* `--api-version <API_VERSION>` — api version to update sdk with (e.g. `2.1.5`)
417429

418430
Default value: `latest`
419431
* `--allow-lint-errors` — update the SDK even thought OpenAPI linting errors were caught in this API version
420432

421433

422434

435+
## `sideko sdk released`
436+
437+
mark an sdk as released
438+
439+
**Usage:** `sideko sdk released [OPTIONS]`
440+
441+
###### **Options:**
442+
443+
* `--repo <REPO>` — path to root of sdk repo
444+
445+
Default value: `./`
446+
* `--id <ID>` — sdk id to be marked as released, if this is provided the command will not look for the sdk id via the --repo
447+
448+
449+
423450
## `sideko doc`
424451

425452
manage api documentation websites

release.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def main():
192192
)
193193
parser.add_argument(
194194
"--version",
195-
required=True,
196195
help="Version to release (if not provided, will use current version)",
197196
)
198197
args = parser.parse_args()
@@ -203,16 +202,22 @@ def main():
203202
# Confirm `gh` CLI is installed & authenticated
204203
run_command("gh auth status", check=True)
205204

206-
current_version = get_current_version()
207-
version = args.version
208-
print(f"\nBumping version from {current_version} to {version}")
209-
210205
# Track all modified files
211206
modified_files = []
207+
version = get_current_version()
208+
209+
if args.version:
210+
print(f"\nBumping version from {version} to {args.version}")
212211

213-
# Update versions in both Cargo.toml files
214-
modified_files.append(update_version(Path("sideko/Cargo.toml"), version))
215-
modified_files.append(update_version(Path("sideko-py/Cargo.toml"), version))
212+
# Update versions in both Cargo.toml files
213+
modified_files.append(update_version(Path("sideko/Cargo.toml"), args.version))
214+
modified_files.append(
215+
update_version(Path("sideko-py/Cargo.toml"), args.version)
216+
)
217+
218+
version = args.version
219+
else:
220+
print(f"\nReleasing current version {version}")
216221

217222
# Delete sideko-py from workspace
218223
modified_files.append(update_workspace_toml(delete=True))

0 commit comments

Comments
 (0)