-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
136 lines (130 loc) · 4.64 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# https://docs.microsoft.com/de-de/azure/devops/pipelines/agents/hosted?view=azure-devops#software
#trigger:
#- master
pr:
- master
# Note: link variable group to build pipeline on Azure by going to Edit and then Triggers
variables:
python-version: "3.7"
vcvrack-sdk-version: "1.1.6"
vcvrack-sdk-conan-channel: "stable"
create-mingw-profile: |
(
echo [settings]
echo os=Windows
echo os_build=Windows
echo arch=x86_64
echo arch_build=x86_64
echo compiler=gcc
echo compiler.version=8
echo compiler.exception=seh
echo compiler.libcxx=libstdc++11
echo compiler.threads=posix
echo build_type=Release
echo [build_requires]
echo mingw-w64/8.1
) > mingw
stages:
- stage: build
displayName: build and test conan package
jobs:
- job: CreatePackage
strategy:
matrix:
Ubuntu:
imageName: ubuntu-latest
prepare-env: |
export PATH="$PATH:/home/vsts/.local/bin"
sudo apt install -y python3-setuptools
pip-command: pip3
conan-libcxx-setting: -s compiler.libcxx=libstdc++11
conan-profile: ""
MacOS:
imageName: macOS-latest
prepare-env: export PATH=$PATH:$HOME/.local/bin
pip-command: pip
conan-libcxx-setting: ""
conan-profile: ""
Windows:
imageName: windows-latest
prepare-env: $(create-mingw-profile)
pip-command: python -m pip
conan-libcxx-setting: -s compiler.libcxx=libstdc++11
conan-profile: "-pr mingw"
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python-version)
- script: |
$(prepare-env)
$(pip-command) install --user --upgrade pip
$(pip-command) install --user conan
conan user
conan create . $(conan-libcxx-setting) $(conan-profile)
displayName: create conan package
- job: Docker
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Arch:
dockerImage: archlinux
install-sudo: pacman -Sy --noconfirm sudo
prepare-env: sudo pacman -Sy --noconfirm python python-pip gcc
pip-command: pip
# CentOS:
# dockerImage: centos
# install-sudo: yum install -y sudo
# prepare-env: sudo yum install -y python3 gcc gcc-c++
# pip-command: pip3
Debian:
dockerImage: debian
install-sudo: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo
prepare-env: sudo apt install -y python3-setuptools python3 python3-pip build-essential
pip-command: pip3
Fedora:
dockerImage: fedora
install-sudo: dnf install -y sudo
prepare-env: sudo dnf install -y python python-pip gcc gcc-c++
pip-command: pip3
container:
image: $(dockerImage)
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container sh -c "$(install-sudo)"
displayName: add sudo to container #https://github.com/Microsoft/azure-pipelines-agent/issues/2043
- script: |
export PATH="$PATH:$HOME/.local/bin"
$(prepare-env)
$(pip-command) install --user --upgrade pip
$(pip-command) install --user conan
conan user
conan create . -s compiler.libcxx=libstdc++11
displayName: conan create package
- stage: publish
displayName: publish conan package
dependsOn: build
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- job: PublishPackage
pool:
vmImage: ubuntu-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python-version)
- script: |
export PATH="$PATH:/home/vsts/.local/bin"
sudo apt install -y python3-setuptools
pip3 install --user --upgrade pip
pip3 install --user conan
conan user
conan config set general.revisions_enabled=1
conan create . vcvrack/$(vcvrack-sdk-conan-channel) -s compiler.libcxx=libstdc++11
conan remote add qno https://qno.jfrog.io/artifactory/api/conan/public-conan --insert
conan user -p $(JFROG_API_KEY) --remote qno $(JFROG_LOGIN_USER)
conan upload vcvrack-sdk/$(vcvrack-sdk-version)@vcvrack/$(vcvrack-sdk-conan-channel) --all --remote qno
displayName: create conan package