-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
65 lines (61 loc) · 1.98 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
trigger:
- master
name: 1.0.$(rev:r)
variables:
artifactName: 'python-egg'
version: $(Build.BuildNumber)
pypiIndex: pygame-minesweeper
pythonVersion: '3.6'
stages:
- stage: ContinuousIntegration
displayName: 'Continuous Integration'
jobs:
- job: Building
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Using Python ${{ variables.pythonVersion }}'
inputs:
versionSpec: $(pythonVersion)
- script: |
python -m pip install -U pipenv
make init
displayName: 'Restoring dependencies'
- task: FileTransform@2
displayName: 'Setting metadata'
inputs:
folderPath: '$(Build.SourcesDirectory)/'
xmlTransformationRules:
jsonTargetFiles: '**/metadata.json'
- script: make egg
displayName: 'Creating Python egg'
- task: PublishPipelineArtifact@1
displayName: 'Publishing artifact'
inputs:
targetPath: '$(Build.Repository.LocalPath)/dist'
artifact: '$(artifactName)'
publishLocation: 'pipeline'
- stage: ContinuousDelivery
displayName: 'Continuous Delivery'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- deployment: Publishing
displayName: 'Publishing'
environment: 'Elitekollektivet'
strategy:
runOnce:
deploy:
steps:
- task: UsePythonVersion@0
displayName: 'Using Python ${{ variables.pythonVersion }}'
inputs:
versionSpec: $(pythonVersion)
- script: python -m pip install --user --upgrade twine
displayName: 'Installing twine'
- task: TwineAuthenticate@1
displayName: 'Authenticating Pypi'
inputs:
pythonUploadServiceConnection: $(pypiIndex)
- script: python -m twine upload --repository $(pypiIndex) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/$(artifactName)/*
displayName: 'Publishing Python egg'