update upload scripts

This commit is contained in:
Shunsuke Shibayama 2023-02-24 18:49:47 +09:00
parent d68fd65c77
commit 195890371a
2 changed files with 29 additions and 16 deletions

View File

@ -1,14 +1,21 @@
if ($PWD.Path -eq "$HOME\GitHub\pylyzer") { if ($PWD.Path -eq "$HOME\GitHub\pylyzer") {
cd crates/py2erg if ($null -eq $env:PYPI_PASSWORD) {
echo "publish py2erg ..." echo "set PYPI_PASSWORD environment variable"
cargo publish exit
# from cargo 1.66 timeout is not needed }
# timeout 12 if ($args[0] -ne "--pip-only") {
cd ../../ cd crates/py2erg
cargo publish echo "publish py2erg ..."
cargo publish
# from cargo 1.66 timeout is not needed
# timeout 12
cd ../../
cargo publish
}
maturin build --release maturin build --release
$ver = cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/' $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 $whl = "target/wheels/$(ls target/wheels | Select-Object -ExpandProperty Name | rg "pylyzer-$ver")"
python -m twine upload $whl -u mtshiba -p $env:PYPI_PASSWORD
echo "completed" echo "completed"
} else { } else {
echo "use this command in the project root" echo "use this command in the project root"

View File

@ -1,14 +1,20 @@
if [ "$PWD" = "$HOME/github/pylyzer" ]; then if [ "$PWD" = "$HOME/github/pylyzer" ]; then
cd crates/py2erg if [ "$PYPI_PASSWORD" = "" ]; then
echo "publish py2erg ..." echo "set PYPI_PASSWORD"
cargo publish exit 1
# from cargo 1.66 timeout is not needed fi
# timeout 12 if [ "$1" != "--pip-only" ]; then
cd ../../ cd crates/py2erg
cargo publish echo "publish py2erg ..."
cargo publish
# from cargo 1.66 timeout is not needed
# timeout 12
cd ../../
cargo publish
fi
maturin build --release maturin build --release
ver=`cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/'` ver=`cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/'`
whl=`ls target/wheels | rg "pylyzer-$ver"` whl=target/wheels/`ls target/wheels | rg "pylyzer-$ver"`
python3 -m twine upload $whl -u mtshiba -p $PYPI_PASSWORD python3 -m twine upload $whl -u mtshiba -p $PYPI_PASSWORD
echo "completed" echo "completed"
else else