Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sdist build to CI #639

Merged
merged 5 commits into from
Apr 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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