mirror of
https://github.com/block/goose.git
synced 2026-04-28 03:29:36 +00:00
bump openapi version directly (#5674)
This commit is contained in:
parent
f0ecf562bb
commit
5110d32142
3 changed files with 6 additions and 3 deletions
5
Justfile
5
Justfile
|
|
@ -300,10 +300,13 @@ prepare-release version:
|
||||||
# see --workspace flag https://doc.rust-lang.org/cargo/commands/cargo-update.html
|
# 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
|
# used to update Cargo.lock after we've bumped versions in Cargo.toml
|
||||||
@cargo update --workspace
|
@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 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 }}"
|
@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
|
# extract version from Cargo.toml
|
||||||
get-tag-version:
|
get-tag-version:
|
||||||
@uvx --from=toml-cli toml get --toml-path=Cargo.toml "workspace.package.version"
|
@uvx --from=toml-cli toml get --toml-path=Cargo.toml "workspace.package.version"
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ fn main() {
|
||||||
fs::create_dir_all(parent).unwrap();
|
fs::create_dir_all(parent).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::write(&output_path, &schema).unwrap();
|
fs::write(&output_path, format!("{schema}\n")).unwrap();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Successfully generated OpenAPI schema at {}",
|
"Successfully generated OpenAPI schema at {}",
|
||||||
output_path.canonicalize().unwrap().display()
|
output_path.canonicalize().unwrap().display()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ echo "🔍 Checking OpenAPI schema is up-to-date..."
|
||||||
|
|
||||||
# Check if the generated schema differs from the committed version
|
# Check if the generated schema differs from the committed version
|
||||||
echo "🔍 Comparing generated schema with 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 ""
|
||||||
echo "❌ OpenAPI schema is out of date!"
|
echo "❌ OpenAPI schema is out of date!"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue