Skip to content

Commit 6e87ee6

Browse files
committed
Deploy releases via Azure
1 parent 92f1f2c commit 6e87ee6

File tree

2 files changed

+55
-19
lines changed

2 files changed

+55
-19
lines changed

.azure-pipelines.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
jobs:
1+
trigger:
2+
branches:
3+
include:
4+
- '*'
5+
tags:
6+
include:
7+
- '*'
8+
9+
stages:
10+
- stage: static
11+
displayName: Static Analysis
12+
jobs:
213
- job: checks
314
displayName: static code analysis
415
pool:
@@ -21,6 +32,9 @@ jobs:
2132
python .azure-pipelines/flake8-validation.py
2233
displayName: Flake8 validation
2334
35+
- stage: tests
36+
displayName: Run unit tests
37+
jobs:
2438
- job: linux
2539
pool:
2640
vmImage: ubuntu-latest
@@ -34,7 +48,6 @@ jobs:
3448
PYTHON_VERSION: 3.8
3549
python39:
3650
PYTHON_VERSION: 3.9
37-
3851
steps:
3952
- template: .azure-pipelines/ci.yml
4053

@@ -51,7 +64,6 @@ jobs:
5164
PYTHON_VERSION: 3.8
5265
python39:
5366
PYTHON_VERSION: 3.9
54-
5567
steps:
5668
- template: .azure-pipelines/ci.yml
5769

@@ -68,6 +80,45 @@ jobs:
6880
PYTHON_VERSION: 3.8
6981
python39:
7082
PYTHON_VERSION: 3.9
71-
7283
steps:
7384
- template: .azure-pipelines/ci.yml
85+
86+
- stage: deploy
87+
displayName: Publish release
88+
dependsOn:
89+
- tests
90+
- static
91+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
92+
jobs:
93+
- job: pypi
94+
displayName: Publish pypi release
95+
pool:
96+
vmImage: ubuntu-latest
97+
steps:
98+
- task: UsePythonVersion@0
99+
displayName: Set up python
100+
inputs:
101+
versionSpec: 3.8
102+
103+
- bash: |
104+
python -m pip install -r requirements_dev.txt
105+
displayName: Install dependencies
106+
107+
- bash: |
108+
python setup.py sdist bdist_wheel
109+
ls -la dist
110+
displayName: Build python package
111+
112+
- task: PublishBuildArtifacts@1
113+
inputs:
114+
pathToPublish: dist/
115+
artifactName: python-release
116+
117+
- task: TwineAuthenticate@1
118+
displayName: Set up credentials
119+
inputs:
120+
pythonUploadServiceConnection: pypi-procrunner
121+
122+
- bash: |
123+
python -m twine upload -r pypi-procrunner --config-file $(PYPIRC_PATH) dist/*.tar.gz dist/*.whl
124+
displayName: Publish package

.travis.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,3 @@ install: pip install -U tox-travis
4242

4343
# Command to run tests, e.g. python setup.py test
4444
script: tox
45-
46-
# Assuming you have installed the travis-ci CLI tool, after you
47-
# create the Github repo and add it to Travis, run the
48-
# following command to finish PyPI deployment setup:
49-
# $ travis encrypt --add deploy.password
50-
deploy:
51-
provider: pypi
52-
distributions: sdist bdist_wheel
53-
user: mgerstel
54-
password:
55-
secure: wIIH59zYpK/AZM7rM2SSz2Iu72cUPBK323X/QhueLc9rHI1i8qCVlEQAO89Oog13fpYOzbgWDFoGnLQahrxf1EHXIpz0+VSZNk1lFsR61sCo4oJEJAklkjwFhb7cdb30/CjJe6z+HqkYkkSu6ErQu5xyPRfPJiJkw0fufmNw8S8XRLDEdi0RV3Jkt+3x5Ndd2D0AIuZhCSznOGZPOuj7G5px8/ZZcbAue76IQ/jyXMu7n6kjcOCg3OJnOK8wjcZ0v68dOl3JAvId2pQlGvgRxOsmc2dFake3YLNzpQMvn+KrqC4yq0K0IBhGFvXwvVnf/jCbEi+onVgBTQcY8fiTD4U2jpWah2kypvGXUGo8Lpr84Ill4ZZKSAxI+zeKslRPGTHV8yqv3KEmlGRPSiUvC2fU/I1tWiMq3P24Wlron5jDegVMqvjMDrJdpud4mDksydvsVJ9/XhCeNeNWzhkMzyzhBjS6Cx97n/znkNR4CzFVsoONvZnaY3GcWqsrSduDFjn77sIb9srbK5W4rPrXZkRB8qcC+/rtyNpw50ItO6uGwRlesNS1oTthwMf9fZXzoFXXkrZuvxCmxVoO+/KKvXTq8w/JMUqYrAdSv5l7ee98lChfksmqk+Bh+DSSkPdo3FpwIDdAeUtm2T/BOAlQvuA4TH486X6bOuei8PAixFs=
56-
on:
57-
tags: true
58-
repo: DiamondLightSource/python-procrunner
59-
python: 3.8

0 commit comments

Comments
 (0)