Skip to content

Commit

Permalink
release TrustSpecCli
Browse files Browse the repository at this point in the history
  • Loading branch information
wkarwacki committed Oct 26, 2024
1 parent 53a87af commit 2d91e1b
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 86 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trust"
version = "0.1.24"
version = "0.1.25"
readme="README.md"
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions cli/py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "trustspeccli"
version = "0.1.24"
version = "{VERSION}"
authors = ["Wojciech Karwacki <karwacki.wojciech@gmail.com>"]
homepage = "https://github.com/wkarwacki/python-openapi-generator-rust"
repository = "https://github.com/wkarwacki/python-openapi-generator-rust"
Expand Down Expand Up @@ -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"
Expand Down
40 changes: 0 additions & 40 deletions cli/py/pyproject.toml.bu

This file was deleted.

25 changes: 25 additions & 0 deletions do_release.sh
Original file line number Diff line number Diff line change
@@ -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/*
6 changes: 3 additions & 3 deletions do_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions plugin/py-binding/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion plugin/py-binding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trustspecpy"
version = "0.1.24"
version = "{VERSION}"
edition = "2021"

[lib]
Expand All @@ -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" }]
19 changes: 0 additions & 19 deletions plugin/py-binding/Cargo.toml.bu

This file was deleted.

19 changes: 1 addition & 18 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down

0 comments on commit 2d91e1b

Please sign in to comment.