From 2d91e1b63399afff32438573c2c8f29ec4a6d00a Mon Sep 17 00:00:00 2001 From: wkarwacki Date: Sat, 26 Oct 2024 17:44:18 +0200 Subject: [PATCH] release TrustSpecCli --- Cargo.toml | 2 +- cli/py/pyproject.toml | 4 ++-- cli/py/pyproject.toml.bu | 40 --------------------------------- do_release.sh | 25 +++++++++++++++++++++ do_test.sh | 6 ++--- plugin/py-binding/Cargo.lock | 4 ++-- plugin/py-binding/Cargo.toml | 5 ++++- plugin/py-binding/Cargo.toml.bu | 19 ---------------- release.sh | 19 +--------------- 9 files changed, 38 insertions(+), 86 deletions(-) delete mode 100644 cli/py/pyproject.toml.bu create mode 100755 do_release.sh delete mode 100644 plugin/py-binding/Cargo.toml.bu diff --git a/Cargo.toml b/Cargo.toml index 1d30240..62974df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trust" -version = "0.1.24" +version = "0.1.25" readme="README.md" edition = "2021" diff --git a/cli/py/pyproject.toml b/cli/py/pyproject.toml index 16687d2..4a62895 100644 --- a/cli/py/pyproject.toml +++ b/cli/py/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "trustspeccli" -version = "0.1.24" +version = "{VERSION}" authors = ["Wojciech Karwacki "] homepage = "https://github.com/wkarwacki/python-openapi-generator-rust" repository = "https://github.com/wkarwacki/python-openapi-generator-rust" @@ -30,7 +30,7 @@ classifiers = [ [tool.poetry.dependencies] python = ">=3.10,<3.11" -trustspecpy = "0.1.24" +trustspecpy = "{VERSION}" [tool.poetry.scripts] trust = "trustspeccli.main:run" diff --git a/cli/py/pyproject.toml.bu b/cli/py/pyproject.toml.bu deleted file mode 100644 index 4a62895..0000000 --- a/cli/py/pyproject.toml.bu +++ /dev/null @@ -1,40 +0,0 @@ -[tool.poetry] -name = "trustspeccli" -version = "{VERSION}" -authors = ["Wojciech Karwacki "] -homepage = "https://github.com/wkarwacki/python-openapi-generator-rust" -repository = "https://github.com/wkarwacki/python-openapi-generator-rust" -documentation = "https://github.com/wkarwacki/python-openapi-generator-rust" -packages = [{include = "trustspeccli", from="src"}] -readme = "README.md" -description = "Web Integration Specification, easy and lightweight alternative to OpenAPI" -classifiers = [ - "Development Status :: 2 - Pre-Alpha", - "Environment :: Console", - "Environment :: Web Environment", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Rust", - "Topic :: Internet", - "Topic :: Internet :: WWW/HTTP :: HTTP Servers", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Software Development", - "Topic :: Software Development :: Code Generators", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed", -] - -[tool.poetry.dependencies] -python = ">=3.10,<3.11" -trustspecpy = "{VERSION}" - -[tool.poetry.scripts] -trust = "trustspeccli.main:run" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/do_release.sh b/do_release.sh new file mode 100755 index 0000000..414645a --- /dev/null +++ b/do_release.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -eox pipefail + +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +cd "$SCRIPT_DIR" || exit + +VERSION=$(yq -oy '.package.version' Cargo.toml) + +trap "mv $SCRIPT_DIR/plugin/py-binding/Cargo.toml.bu $SCRIPT_DIR/plugin/py-binding/Cargo.toml; mv $SCRIPT_DIR/cli/py/pyproject.toml.bu $SCRIPT_DIR/cli/py/pyproject.toml" EXIT + +cp $SCRIPT_DIR/plugin/py-binding/Cargo.toml $SCRIPT_DIR/plugin/py-binding/Cargo.toml.bu +sed -i "s/{VERSION}/$VERSION/g" $SCRIPT_DIR/plugin/py-binding/Cargo.toml + +cp $SCRIPT_DIR/cli/py/pyproject.toml $SCRIPT_DIR/cli/py/pyproject.toml.bu +sed -i "s/{VERSION}/$VERSION/g" $SCRIPT_DIR/cli/py/pyproject.toml + +bash do_test.sh + +cd plugin/py-binding +bash build.sh +maturin upload target/wheels/* + +cd $SCRIPT_DIR/cli/py +twine upload dist/* diff --git a/do_test.sh b/do_test.sh index e097710..c063d95 100755 --- a/do_test.sh +++ b/do_test.sh @@ -8,9 +8,9 @@ cd "$SCRIPT_DIR" || exit rm -rf test/default mkdir -p test/default/spec -cargo test -- --nocapture - -bash test/integration/test.sh +#cargo test -- --nocapture +# +#bash test/integration/test.sh bash test/cli/test.sh diff --git a/plugin/py-binding/Cargo.lock b/plugin/py-binding/Cargo.lock index 9e95c12..8c6d76a 100644 --- a/plugin/py-binding/Cargo.lock +++ b/plugin/py-binding/Cargo.lock @@ -984,7 +984,7 @@ dependencies = [ [[package]] name = "trust" -version = "0.1.24" +version = "0.1.25" dependencies = [ "clap", "convert_case", @@ -1007,7 +1007,7 @@ dependencies = [ [[package]] name = "trustspecpy" -version = "0.1.24" +version = "0.1.25" dependencies = [ "clap", "pyo3", diff --git a/plugin/py-binding/Cargo.toml b/plugin/py-binding/Cargo.toml index 84cbc0f..b2b74c1 100644 --- a/plugin/py-binding/Cargo.toml +++ b/plugin/py-binding/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trustspecpy" -version = "0.1.24" +version = "{VERSION}" edition = "2021" [lib] @@ -17,3 +17,6 @@ version = "0.22.2" [features] extension-module = ["pyo3/extension-module"] default = ["extension-module"] + +[tool.maturin] +include = [{ path = "../../src/lib/gen/python/**/templates", format = "sdist" }] diff --git a/plugin/py-binding/Cargo.toml.bu b/plugin/py-binding/Cargo.toml.bu deleted file mode 100644 index ba127c7..0000000 --- a/plugin/py-binding/Cargo.toml.bu +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "trustspecpy" -version = "{VERSION}" -edition = "2021" - -[lib] -name = "trustspecpy" -crate-type = ["cdylib"] - -[dependencies] -clap = { version = "4.5.1", features = ["derive"] } -trust = { path = "../../" } - -[dependencies.pyo3] -version = "0.22.2" - -[features] -extension-module = ["pyo3/extension-module"] -default = ["extension-module"] diff --git a/release.sh b/release.sh index 0af1cea..c4fbb1a 100755 --- a/release.sh +++ b/release.sh @@ -5,24 +5,7 @@ set -eox pipefail SCRIPT_DIR=$(dirname "$(readlink -f "$0")") cd "$SCRIPT_DIR" || exit -VERSION=$(yq -oy '.package.version' Cargo.toml) - -trap "mv $SCRIPT_DIR/plugin/py-binding/Cargo.toml.bu $SCRIPT_DIR/plugin/py-binding/Cargo.toml; mv $SCRIPT_DIR/cli/py/pyproject.toml.bu $SCRIPT_DIR/cli/py/pyproject.toml" EXIT - -cp $SCRIPT_DIR/plugin/py-binding/Cargo.toml $SCRIPT_DIR/plugin/py-binding/Cargo.toml.bu -sed -i "s/{VERSION}/$VERSION/g" $SCRIPT_DIR/plugin/py-binding/Cargo.toml - -cp $SCRIPT_DIR/cli/py/pyproject.toml $SCRIPT_DIR/cli/py/pyproject.toml.bu -sed -i "s/{VERSION}/$VERSION/g" $SCRIPT_DIR/cli/py/pyproject.toml - -bash do_test.sh - -cd plugin/py-binding -bash build.sh -maturin upload target/wheels/* - -cd $SCRIPT_DIR/cli/py -twine upload dist/* +bash do_release.sh cd $SCRIPT_DIR git add .