bump openapi version directly (#5674)

This commit is contained in:
Jack Amadeo 2025-11-11 07:15:42 -08:00 committed by GitHub
parent f0ecf562bb
commit 5110d32142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -300,10 +300,13 @@ prepare-release version:
# see --workspace flag https://doc.rust-lang.org/cargo/commands/cargo-update.html
# used to update Cargo.lock after we've bumped versions in Cargo.toml
@cargo update --workspace
@just generate-openapi
@just set-openapi-version {{ version }}
@git add Cargo.toml Cargo.lock ui/desktop/package.json ui/desktop/package-lock.json ui/desktop/openapi.json
@git commit --message "chore(release): release version {{ version }}"
set-openapi-version version:
@jq '.info.version |= "{{ version }}"' ui/desktop/openapi.json > ui/desktop/openapi.json.tmp && mv ui/desktop/openapi.json.tmp ui/desktop/openapi.json
# extract version from Cargo.toml
get-tag-version:
@uvx --from=toml-cli toml get --toml-path=Cargo.toml "workspace.package.version"

View file

@ -19,7 +19,7 @@ fn main() {
fs::create_dir_all(parent).unwrap();
}
fs::write(&output_path, &schema).unwrap();
fs::write(&output_path, format!("{schema}\n")).unwrap();
eprintln!(
"Successfully generated OpenAPI schema at {}",
output_path.canonicalize().unwrap().display()

View file

@ -8,7 +8,7 @@ echo "🔍 Checking OpenAPI schema is up-to-date..."
# Check if the generated schema differs from the committed version
echo "🔍 Comparing generated schema with committed version..."
if ! git diff --exit-code ui/desktop/openapi.json ui/desktop/src/api/; then
if ! git diff --ignore-space-change --exit-code ui/desktop/openapi.json ui/desktop/src/api/; then
echo ""
echo "❌ OpenAPI schema is out of date!"
echo ""