set build type

This commit is contained in:
Jack Robison 2018-10-22 16:31:05 -04:00
parent 4596d5c26f
commit 8139f93ff1
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 32 additions and 0 deletions

View file

@ -84,6 +84,7 @@ jobs:
- pip3 install pyinstaller
- pip3 install git+https://github.com/lbryio/torba.git
- pip3 install git+https://github.com/lbryio/lbryschema.git
- python scripts/set_build.py
- pip3 install -e .
script:
- pyinstaller -F -n lbrynet lbrynet/cli.py

30
scripts/set_build.py Normal file
View file

@ -0,0 +1,30 @@
"""Set the build version to be 'dev', 'qa', 'rc', 'release'"""
import os.path
import re
import subprocess
import sys
def main():
build = get_build()
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
with open(os.path.join(root_dir, 'lbrynet', 'build_type.py'), 'w') as f:
f.write("BUILD = '{}'\n".format(build))
def get_build():
try:
tag = subprocess.check_output(['git', 'describe', '--exact-match', '--all']).strip()
if re.match('v\d+\.\d+\.\d+rc\d+', tag):
return 'rc'
else:
return 'release'
except subprocess.CalledProcessError:
# if the build doesn't have a tag
return 'qa'
if __name__ == '__main__':
sys.exit(main())

View file

@ -16,6 +16,7 @@ cd lbryschema && pip install -e . && cd ..
cd torba && pip install -e . && cd ..
cd lbry
python scripts/set_build.py
pip install -e .
pyinstaller --additional-hooks-dir=scripts/. -F -n lbrynet lbrynet/cli.py
wine dist/lbrynet.exe --version