ci: inject release hash + branch during build

This commit is contained in:
Nicolas Giard 2022-03-21 14:44:58 -04:00 committed by NGPixel
parent 3a6a648d46
commit adc6331727
No known key found for this signature in database
GPG key ID: 8FDA2F1757F60D63
2 changed files with 9 additions and 1 deletions

View file

@ -89,6 +89,8 @@ jobs:
sh ./dev/deploy/build.sh sh ./dev/deploy/build.sh
echo "Setting version $PKG_VERSION_STRICT..." echo "Setting version $PKG_VERSION_STRICT..."
sed -i -r -e "s/^__version__ += '.*'$/__version__ = '$PKG_VERSION_STRICT'/" ietf/__init__.py sed -i -r -e "s/^__version__ += '.*'$/__version__ = '$PKG_VERSION_STRICT'/" ietf/__init__.py
sed -i -r -e "s/^__release_hash__ += '.*'$/__release_hash__ = '$GITHUB_SHA'/" ietf/__init__.py
sed -i -r -e "s/^__release_branch__ += '.*'$/__release_branch__ = '$GITHUB_REF_NAME'/" ietf/__init__.py
echo "Build release tarball..." echo "Build release tarball..."
mkdir -p /home/runner/work/release mkdir -p /home/runner/work/release
tar -czf /home/runner/work/release/release.tar.gz -X dev/deploy/exclude-patterns.txt . tar -czf /home/runner/work/release/release.tar.gz -X dev/deploy/exclude-patterns.txt .

View file

@ -6,7 +6,13 @@ from . import checks # pyflakes:ignore
# Version must stay in single quotes for automatic CI replace # Version must stay in single quotes for automatic CI replace
# Don't add patch number here: # Don't add patch number here:
__version__ = '7.46.1.dev0' __version__ = '7.0.0-dev'
# Release hash must stay in single quotes for automatic CI replace
__release_hash__ = ''
# Release branch must stay in single quotes for automatic CI replace
__release_branch__ = ''
# set this to ".p1", ".p2", etc. after patching # set this to ".p1", ".p2", etc. after patching
__patch__ = "" __patch__ = ""