Add upload scripts

This commit is contained in:
Shunsuke Shibayama 2023-02-24 18:09:57 +09:00
parent 062ea928b6
commit 0f134f7be0
3 changed files with 31 additions and 14 deletions

View File

@ -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
)

15
cargo_publish.ps1 Normal file
View File

@ -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"
}

16
cargo_publish.sh Normal file
View File

@ -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