forked from LBRYCommunity/lbry-sdk
set build type
This commit is contained in:
parent
4596d5c26f
commit
8139f93ff1
3 changed files with 32 additions and 0 deletions
|
@ -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
30
scripts/set_build.py
Normal 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())
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue