File: test-version-exists

package info (click to toggle)
aws-crt-python 0.28.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,428 kB
  • sloc: ansic: 437,955; python: 27,657; makefile: 5,855; sh: 4,289; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (26 lines) | stat: -rwxr-xr-x 1,020 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -ex
#force a failure if there's no tag
GIT_TAG=$(git describe --tags)
# Check if the git tag version starts with 'v'
if [[ "$GIT_TAG" != v* ]]; then
    echo "Current tag version does not start with 'v', please ensure the tag is correctly formatted."
    exit 1
fi
# now get the tag without leading 'v'
CURRENT_TAG=$(echo $GIT_TAG | cut -f2 -dv)
# convert v0.2.12-2-g50254a9 to 0.2.12
CURRENT_TAG_VERSION=$(git describe --tags | cut -f1 -d'-' | cut -f2 -dv)
# if there's a hash on the tag, then this is not a release tagged commit
if [ "$CURRENT_TAG" != "$CURRENT_TAG_VERSION" ]; then
    echo "Current tag version is not a release tag, cut a new release if you want to publish."
    exit 1
fi

if python3 -m pip install --no-cache-dir -vvv awscrt==$CURRENT_TAG_VERSION; then
    echo "$CURRENT_TAG_VERSION is already in pypi, cut a new tag if you want to upload another version."
    exit 1
fi

echo "$CURRENT_TAG_VERSION currently does not exist in pypi, allowing pipeline to continue."
exit 0