-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
123 lines (106 loc) · 4.37 KB
/
azure-pipelines.yml
File metadata and controls
123 lines (106 loc) · 4.37 KB
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
trigger:
branches:
include:
- master
- refs/tags/*
exclude:
- refs/tags/nightly
pr:
- master
# resources:
# repositories:
# - repository: templates
# type: github
# name: jmwright/conda-packages
# endpoint: CadQuery
parameters:
- name: minor
type: object
default:
- 11
- name: location
type: string
default: 'conda'
stages:
- stage: build_conda_package
jobs:
- ${{ each minor in parameters.minor }}:
- job: Linux_3_${{ minor }}
timeoutInMinutes: 360
pool:
vmImage: ubuntu-latest
steps:
# this step is needed for OCC to find fonts
- bash: |
sudo apt-get -q -y install gsfonts xfonts-utils && \
sudo mkfontscale /usr/share/fonts/type1/gsfonts/ && \
sudo mkfontdir /usr/share/fonts/type1/gsfonts/
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Help OCC find fonts'
# Ubunut install opengl items
- ${{ if contains('ubuntu-latest', 'Ubuntu') }}:
- bash: |
sudo apt-get update && \
sudo apt-get -q -y install libglu1-mesa-dev freeglut3-dev mesa-common-dev
displayName: 'Install OpenGL headers'
# install conda for mac
- bash: brew install miniforge && ls /usr/local/Caskroom/miniforge/base/bin
displayName: 'MacOS install miniforge'
condition: eq( variables['Agent.OS'], 'Darwin' )
#activate conda
- bash: echo "##vso[task.prependpath]/usr/local/Caskroom/miniforge/base/bin"
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: 'Add conda to PATH - OSX'
- bash: echo "##vso[task.prependpath]$CONDA/bin"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Add conda to PATH - Linux'
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Add conda to PATH - Windows'
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Library\bin"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Add condabin to PATH - Windows'
# install mamba
- bash: |
conda config --set anaconda_upload yes --set always_yes yes --set solver libmamba && \
conda config --add channels conda-forge && \
conda install -c conda-forge -q mamba micromamba conda-devenv libsolv conda-libmamba-solver && \
env && \
conda info && \
conda list
displayName: 'Install mamba, boa; report config and info'
- bash: conda create --yes --quiet --name build_env -c conda-forge conda-build boa conda-verify libarchive python=3.12 anaconda-client
displayName: Create Anaconda environment
- bash: |
cd ${{ parameters.location }} && \
conda run -n build_env conda mambabuild -c conda-forge -c cadquery --output-folder . . && \
full_path=$(conda run -n build_env conda build --output -c conda-forge -c cadquery --output-folder . . ) && \
echo $full_path && \
base_name=$(basename $full_path) && \
split_name=($(IFS=-; tmp=($base_name); echo ${tmp[@]})) && \
package_name=${split_name[@]: 0 : ${#split_name[@]} - 2} && \
package_name=${package_name/ /-} && \
version_name=${split_name[-2]} && \
echo "Removing $base_name" && \
conda run -n build_env anaconda -v -t $TOKEN remove --force "cadquery/$package_name/$version_name" && \
echo "Uploading $full_path" && \
conda run -n build_env anaconda -v -t $TOKEN upload -u cadquery --force $full_path && \
cd ..
displayName: 'Run conda build'
failOnStderr: false
condition: ne(variables['Build.Reason'], 'PullRequest')
env:
PYTHON_VERSION: 3.${{ minor }}
PACKAGE_VERSION: $(Build.SourceBranchName)
TOKEN: $(anaconda.TOKEN)
- bash: |
cd ${{ parameters.location }} && \
conda run -n build_env conda mambabuild -c conda-forge -c cadquery . && \
cd ..
displayName: 'Run conda build without upload'
failOnStderr: false
condition: eq(variables['Build.Reason'], 'PullRequest')
env:
PYTHON_VERSION: 3.${{ minor }}
PACKAGE_VERSION: $(Build.SourceBranchName)
TOKEN: $(anaconda.TOKEN)