-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
80 lines (68 loc) · 2.42 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
trigger:
- master
parameters:
- name: package_version
displayName: Package Version
type: string
default: 2.0
variables:
- name: PACKAGE_VERSION
value: ${{ parameters.package_version }}.$(Build.BuildId)
- name: vmImageName
value: 'ubuntu-22.04'
stages:
- stage: Build
displayName: Build Package
jobs:
- job:
displayName: ${{ variables.vmImageName }}
pool:
vmImage: $(vmImageName)
strategy:
matrix:
Python38:
python.version: '3.8'
env_file: 'environment_py38.yml'
Python310:
python.version: '3.10'
env_file: 'environment_py310.yml'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
# Install mamba to manage dependencies faster
# - bash: |
# conda config --set allow_conda_downgrades true
# conda install conda=4.12.0 -y
# conda install --yes mamba -c conda-forge
# displayName: Install Mamba package manager
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
artifactFeeds: 'Warn-on-Forecast/wofs-post'
- bash: |
# workaround based on recent failures
# rm /usr/share/miniconda/pkgs/cache/*.json
conda env create --file $(env_file)
displayName: Create mamba environment
- bash: |
source activate monte_python
python setup.py bdist_wheel
displayName: Build wheel
- script: 'pip install twine keyring artifacts-keyring'
displayName: Install publishing prerequisites
- task: TwineAuthenticate@1
inputs:
artifactFeed: 'Warn-on-Forecast/wofs-post'
displayName: Authenticate Twine
- script: |
python -m twine upload -r wofs-post --config-file $(PYPIRC_PATH) --skip-existing dist/*.whl
displayName: Publish Package
- task: GithubRelease@1
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: WarnOnForecast-Github
repositoryName: WarnOnForecast/MontePython
isPreRelease: false
tagSource: userSpecifiedTag
assets: dist/*.whl
tag: $(PACKAGE_VERSION)-py$(python.version)