Compare commits
4 commits
44bd9a6446
...
698fd52a03
Author | SHA1 | Date | |
---|---|---|---|
|
698fd52a03 | ||
|
71a49f7b2f | ||
|
e38e5b10a7 | ||
|
3a443e1fa5 |
1 changed files with 30 additions and 3 deletions
33
build.sh
33
build.sh
|
@ -9,11 +9,27 @@ cd $( dirname $0 )
|
||||||
echo "Clean previous build..."
|
echo "Clean previous build..."
|
||||||
rm -fr dist deb_dist
|
rm -fr dist deb_dist
|
||||||
|
|
||||||
|
if [ -n "$CI" -a $UID -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "CI environment detected, set current directory as git safe for root"
|
||||||
|
git config --global --add safe.directory $(pwd)
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Detect version using git describe..."
|
echo "Detect version using git describe..."
|
||||||
VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"
|
VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"
|
||||||
|
|
||||||
echo "Set version=$VERSION in setup.py using sed..."
|
echo "Computing python version..."
|
||||||
sed -i "s/^version *=.*$/version = '$VERSION'/" setup.py
|
if [ $( echo "$VERSION"|grep -c "-" ) -gt 0 ]
|
||||||
|
then
|
||||||
|
echo "Development version detected ($VERSION), compute custom python dev version"
|
||||||
|
PY_VERSION="$( echo "$VERSION"|sed 's/-\([0-9]\)\+-.*$/.dev\1/' )"
|
||||||
|
else
|
||||||
|
echo "Clean tagged version detected, use it"
|
||||||
|
PY_VERSION="$VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Set version=$PY_VERSION in setup.py using sed..."
|
||||||
|
sed -i "s/^version *=.*$/version = '$PY_VERSION'/" setup.py
|
||||||
|
|
||||||
if [ -d venv ]
|
if [ -d venv ]
|
||||||
then
|
then
|
||||||
|
@ -72,6 +88,10 @@ else
|
||||||
echo "Use debian codename from environment ($DEBIAN_CODENAME)"
|
echo "Use debian codename from environment ($DEBIAN_CODENAME)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Compute debian package version
|
||||||
|
DEB_VERSION_SUFFIX="-1"
|
||||||
|
DEB_VERSION="$VERSION$DEB_VERSION_SUFFIX"
|
||||||
|
|
||||||
echo "Generate debian changelog using gitdch..."
|
echo "Generate debian changelog using gitdch..."
|
||||||
GITDCH_ARGS=('--verbose')
|
GITDCH_ARGS=('--verbose')
|
||||||
[ -n "$QUIET_ARG" ] && GITDCH_ARGS=('--warning')
|
[ -n "$QUIET_ARG" ] && GITDCH_ARGS=('--warning')
|
||||||
|
@ -87,11 +107,18 @@ then
|
||||||
fi
|
fi
|
||||||
$GITDCH \
|
$GITDCH \
|
||||||
--package-name mylib \
|
--package-name mylib \
|
||||||
--version "${VERSION}" \
|
--version "${DEB_VERSION}" \
|
||||||
|
--version-suffix "${DEB_VERSION_SUFFIX}" \
|
||||||
--code-name $DEBIAN_CODENAME \
|
--code-name $DEBIAN_CODENAME \
|
||||||
--output debian/changelog \
|
--output debian/changelog \
|
||||||
--release-notes ../../dist/release_notes.md \
|
--release-notes ../../dist/release_notes.md \
|
||||||
--path ../../ \
|
--path ../../ \
|
||||||
|
--exclude "^CI: " \
|
||||||
|
--exclude "\.?woodpecker(\.yml)?" \
|
||||||
|
--exclude "build(\.sh)?" \
|
||||||
|
--exclude "tests(\.sh)?" \
|
||||||
|
--exclude "README(\.md)?" \
|
||||||
|
--exclude "^Merge branch " \
|
||||||
"${GITDCH_ARGS[@]}"
|
"${GITDCH_ARGS[@]}"
|
||||||
|
|
||||||
echo "Add custom package name for dependencies..."
|
echo "Add custom package name for dependencies..."
|
||||||
|
|
Loading…
Reference in a new issue