use git describe as version
This commit is contained in:
parent
780c742407
commit
7ea447ef35
2 changed files with 22 additions and 1 deletions
3
build.sh
3
build.sh
|
@ -24,6 +24,7 @@ if [ -n "${TEAMCITY_VERSION:-}" ]; then
|
|||
source "$VENV/bin/activate"
|
||||
set -u
|
||||
pip install -U pip setuptools pyinstaller
|
||||
python set-version.py
|
||||
fi
|
||||
|
||||
npm install
|
||||
|
@ -75,6 +76,6 @@ if [ -n "${TEAMCITY_VERSION:-}" ]; then
|
|||
# it to reliably work and it also seemed difficult to configure. Not proud of
|
||||
# this, but it seemed better to write my own.
|
||||
pip install PyGithub uritemplate
|
||||
python release-on-tag.py --force
|
||||
python release-on-tag.py
|
||||
deactivate
|
||||
fi
|
||||
|
|
20
set-version.py
Normal file
20
set-version.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
"""Set the package version to the output of `git describe`"""
|
||||
|
||||
import json
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
version = subprocess.check_output(['git', 'describe']).strip()
|
||||
package_file = os.path.join('app', 'package.json')
|
||||
with open(package_file) as fp:
|
||||
package_data = json.load(fp)
|
||||
package_data['version'] = version
|
||||
with open(package_file, 'w') as fp:
|
||||
json.dump(package_data, fp, indent=2, separators=(',', ': '))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
Loading…
Add table
Reference in a new issue