CI: update scripts

This commit is contained in:
Shunsuke Shibayama 2023-04-29 12:36:29 +09:00
parent 0d9b37e006
commit 964a3d1284
3 changed files with 18 additions and 11 deletions

View file

@ -24,7 +24,8 @@ jobs:
run: |
rustup update stable
cargo login ${{ secrets.CARGO_TOKEN }}
./cargo-publish.sh
chmod +x cargo_publish.sh
./cargo_publish.sh
pypi:
strategy:
matrix:

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}

View file

@ -1,21 +1,21 @@
if [[ "$PWD" == */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
# from cargo 1.66 timeout is not needed
# timeout 12
cd ../../
cargo publish
fi
maturin build --release
ver=`cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/'`
whl=target/wheels/`ls target/wheels | rg "pylyzer-$ver"`
python3 -m twine upload $whl -u mtshiba -p $PYPI_PASSWORD
if [ "$1" != "--cargo-only" ]; then
if [ "$PYPI_PASSWORD" = "" ]; then
echo "set PYPI_PASSWORD"
exit 1
fi
maturin build --release
ver=`cat Cargo.toml | rg "^version =" | sed -r 's/^version = "(.*)"/\1/'`
whl=target/wheels/`ls target/wheels | rg "pylyzer-$ver"`
python3 -m twine upload $whl -u mtshiba -p $PYPI_PASSWORD
fi
echo "completed"
else
echo "use this command in the project root"