mirror of
https://github.com/davidhalter/parso.git
synced 2026-05-19 15:00:08 +08:00
Change deploy script to better handle tags that already exist and move to a separate folder to avoid deploying files that make no sense.
This commit is contained in:
@@ -1,10 +1,33 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# The script creates a separate folder in build/ and creates tags there, pushes
|
||||||
|
# them and then uploads the package to PyPI.
|
||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
cd CORRECT_FOLDER
|
||||||
|
|
||||||
|
PROJECT_NAME=parso
|
||||||
|
PROJECT=git-clone
|
||||||
|
BRANCH=master
|
||||||
|
FOLDER=build/$PROJECT
|
||||||
|
|
||||||
|
cd $FOLDER
|
||||||
|
git checkout $BRANCH
|
||||||
|
|
||||||
# Create tag
|
# Create tag
|
||||||
git tag v$(python -c 'import parso; print(parso.__version__)')
|
tag=v$(python -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)")
|
||||||
git push --tags
|
|
||||||
|
master_ref=$(git show-ref -s $BRANCH)
|
||||||
|
tag_ref=$(git show-ref -s $tag | true)
|
||||||
|
if [ $tag_ref ]; then
|
||||||
|
if [ $tag_ref != $master_ref ]; then
|
||||||
|
echo 'Cannot tag something that has already been tagged with another commit.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
git tag $BRANCH
|
||||||
|
git push --tags
|
||||||
|
fi
|
||||||
|
|
||||||
# Package and upload to PyPI
|
# Package and upload to PyPI
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
|
|||||||
Reference in New Issue
Block a user