mirror of
https://github.com/KevinMidboe/delugeClient.git
synced 2025-10-29 12:00:13 +00:00
If source is newer than pypi, exit 0 and continue pipeline
This commit is contained in:
15
.drone.yml
15
.drone.yml
@@ -38,14 +38,19 @@ platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: Newer version to publish?
|
||||
image: python:3.10
|
||||
commands:
|
||||
- bash publish_version?.sh
|
||||
|
||||
- name: Test PyPi publish
|
||||
image: python:3.10
|
||||
commands:
|
||||
- make dist
|
||||
- pip3 install -r requirements.txt
|
||||
- pip3 install twine
|
||||
- twine check dist/*
|
||||
- twine upload --repository delugeClient-kevin dist/*
|
||||
- make dist
|
||||
- pip3 install -r requirements.txt
|
||||
- pip3 install twine
|
||||
- twine check dist/*
|
||||
- twine upload --repository delugeClient-kevin dist/*
|
||||
|
||||
- name: PyPi publish
|
||||
image: python:3.10
|
||||
|
||||
20
publish_version?.sh
Normal file
20
publish_version?.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
PYPI_VERSION=$(pip3 show delugeClient-kevin | awk '$1 ~ /Version:/ { print $2 }')
|
||||
SOURCE_VERSION=$(python3 delugeClient/__version__.py)
|
||||
|
||||
echo "hello"
|
||||
echo "pypi version: $PYPI_VERSION"
|
||||
echo "source version: $SOURCE_VERSION"
|
||||
|
||||
function version {
|
||||
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
|
||||
}
|
||||
|
||||
if [ $(version $SOURCE_VERSION) -gt $(version $PYPI_VERSION) ]; then
|
||||
echo "source is newer than pypi"
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
echo "source is same or oldre, but not newer"
|
||||
fi
|
||||
Reference in New Issue
Block a user