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,4 +1,9 @@
if ($PWD.Path -eq "$HOME\GitHub\pylyzer") {
if ($null -eq $env:PYPI_PASSWORD) {
echo "set PYPI_PASSWORD environment variable"
exit
}
if ($args[0] -ne "--pip-only") {
cd crates/py2erg
echo "publish py2erg ..."
cargo publish
@ -6,9 +11,11 @@ if ($PWD.Path -eq "$HOME\GitHub\pylyzer") {
# 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
$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"
} else {
echo "use this command in the project root"

View File

@ -1,4 +1,9 @@
if [ "$PWD" = "$HOME/github/pylyzer" ]; then
if [ "$PYPI_PASSWORD" = "" ]; then
echo "set PYPI_PASSWORD"
exit 1
fi
if [ "$1" != "--pip-only" ]; then
cd crates/py2erg
echo "publish py2erg ..."
cargo publish
@ -6,9 +11,10 @@ if [ "$PWD" = "$HOME/github/pylyzer" ]; then
# timeout 12
cd ../../
cargo publish
fi
maturin build --release
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
echo "completed"
else