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
5 changes: 4 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/goose-server/src/bin/generate_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-openapi-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
Loading