diff --git a/cargo_publish.bat b/cargo_publish.bat deleted file mode 100644 index 574ead6..0000000 --- a/cargo_publish.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -if %~dp0 == C:%homepath%\GitHub\pylyzer\ ( - cd crates/py2erg - echo publish py2erg ... - cargo publish - rem from cargo 1.66 timeout is not needed - rem timeout 12 - cd ../../ - cargo publish - echo completed -) else ( - echo Use this command in the project root -) diff --git a/cargo_publish.ps1 b/cargo_publish.ps1 new file mode 100644 index 0000000..66392fe --- /dev/null +++ b/cargo_publish.ps1 @@ -0,0 +1,15 @@ +if ($PWD.Path -eq "$HOME\GitHub\pylyzer") { + cd crates/py2erg + echo "publish py2erg ..." + cargo publish + # from cargo 1.66 timeout is not needed + # timeout 12 + cd ../../ + cargo publish + maturin build --release + $ver = cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/' + python -m twine upload "target/wheels/pylyzer-$ver-py3-none-win_amd64.whl" -u mtshiba -p $env:PYPI_PASSWORD + echo "completed" +} else { + echo "use this command in the project root" +} diff --git a/cargo_publish.sh b/cargo_publish.sh new file mode 100644 index 0000000..0937eec --- /dev/null +++ b/cargo_publish.sh @@ -0,0 +1,16 @@ +if [ "$PWD" = "$HOME/github/pylyzer" ]; then + cd crates/py2erg + echo "publish py2erg ..." + cargo publish + # from cargo 1.66 timeout is not needed + # timeout 12 + cd ../../ + cargo publish + maturin build --release + ver=`cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/'` + whl=`ls target/wheels | rg "pylyzer-$ver"` + python3 -m twine upload $whl -u mtshiba -p $PYPI_PASSWORD + echo "completed" +else + echo "use this command in the project root" +fi