Skip to content

Commit

Permalink
add sdist build to CI (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl authored Apr 7, 2019
1 parent 85649a8 commit 1a2e331
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
23 changes: 21 additions & 2 deletions data/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,31 @@ jobs:
python -m pip install --upgrade pip
pip install -r data/requirements.txt
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb
pip install pytest pytest-xvfb pytest-cov pytest-xdist
coverage --version
pip install twine setuptools wheel pytest pytest-xvfb pytest-cov pytest-xdist
python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()"
displayName: 'Install dependencies'
- script: python setup.py build_ext --inplace
displayName: "Build extensions"

- script: python setup.py sdist
displayName: "Build sdist"
condition: eq(variables['python.version'], '3.7')

- script: twine upload --skip-existing dist/*.gz
displayName: "Upload sdist to PyPi"
condition: and(eq(variables['python.version'], '3.7'), contains(variables['Build.SourceBranch'], 'refs/tags/'))
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"

- task: PublishBuildArtifacts@1
condition: eq(variables['python.version'], '3.7')
inputs:
pathtoPublish: dist/
artifactName: 'dist'
displayName: "Publish Build Artifacts"

- script: |
touch tests/show_gui
Expand Down
11 changes: 0 additions & 11 deletions data/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ def cleanup():


def release():
try:
import twine
except ImportError:
print("Twine is required for PyPi release!")
sys.exit(1)

script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
script_dir = os.path.realpath(os.path.join(script_dir, ".."))
os.chdir(script_dir)
Expand Down Expand Up @@ -69,11 +63,6 @@ def release():
call(["git", "tag", "v" + cur_version, "-m", "version " + cur_version])
call(["git", "push", "origin", "--tags"]) # Creates tar package on https://github.com/jopohl/urh/tarball/va.b.c.d

# region Publish to PyPi
call(["python", "setup.py", "sdist"])
call("twine upload dist/*", shell=True)
# endregion

os.remove(os.path.join(tempfile.gettempdir(), "urh_releasing"))

# region Build docker image and push to DockerHub
Expand Down

0 comments on commit 1a2e331

Please sign in to comment.