Update build scripts and version mechanism
This commit is contained in:
Родитель
8884fd3a29
Коммит
7de285d948
|
@ -1,8 +1,15 @@
|
|||
language: python
|
||||
python:
|
||||
- '3.6'
|
||||
before_install:
|
||||
- echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
|
||||
- sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
|
||||
- sudo apt-get install -y apt-transport-https
|
||||
- sudo apt-get -qq update && sudo apt-get install -y azure-cli
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
script:
|
||||
- pylint src
|
||||
- "./setup.py bdist_wheel"
|
||||
- export
|
||||
- ./setup.py bdist_wheel
|
||||
- ./publish.sh
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z $TRAVIS_TAG ]; then
|
||||
echo "Skip publishing since it is not a build triggered by a tag." >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd dist
|
||||
wheel_file=`ls adx_automation_cli-*-py3-none-any.whl`
|
||||
|
||||
version=${wheel_file/adx_automation_cli-/}
|
||||
version=${version/-py3-none-any.whl/}
|
||||
echo $version
|
||||
|
||||
az storage blob upload -c client -f $wheel_file -n archive/$wheel_file --validate-content --no-progress
|
||||
az storage blob upload -c client -f $wheel_file -n adx_automation_cli_latest.whl --validate-content --no-progress
|
|
@ -19,5 +19,6 @@ urllib3==1.22
|
|||
wrapt==1.10.11
|
||||
kubernetes==4.0.0
|
||||
websocket-client==0.40.0
|
||||
wheel==0.30.0
|
||||
|
||||
-e .
|
||||
|
|
14
setup.py
14
setup.py
|
@ -1,8 +1,20 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import datetime
|
||||
from setuptools import setup
|
||||
|
||||
VERSION = "0.10.2"
|
||||
def get_version() -> str:
|
||||
if "TRAVIS" in os.environ:
|
||||
tag = os.environ.get('TRAVIS_TAG', None)
|
||||
if tag:
|
||||
return tag
|
||||
else:
|
||||
return f'0.0.0.{os.environ["TRAVIS_BUILD_NUMBER"]}'
|
||||
return f'0.0.0.{datetime.datetime.now().strftime("%Y%m%d%H%M%S")}'
|
||||
|
||||
|
||||
VERSION = get_version()
|
||||
|
||||
CLASSIFIERS = [
|
||||
'Development Status :: 4 - Beta',
|
||||
|
|
Загрузка…
Ссылка в новой задаче