-
Notifications
You must be signed in to change notification settings - Fork 8
239 lines (196 loc) · 7.48 KB
/
conan-package-release.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: Create Conan Package Release
on:
workflow_dispatch:
inputs:
organization:
description: 'Organization'
required: false
default: Ultimaker
type: string
repository:
description: 'repository'
default: 'Cura'
type: choice
options:
- Cura
- Uranium
- fdm_materials
- Cura-binary-data
- CuraEngine
- CuraEngine_grpc_definitions
- CuraEngine_plugin_gradual_flow
- synsepalum-dulcificum
- libArcus
- libnest2d
- libSavitar
- pyarcus
- pynest2d
- pySavitar
- NativeCADPlugin
ref_name:
description: 'Git ref (main, 5.7, sha)'
required: false
default: 'main'
type: string
version:
description: 'Semantic Version (5.7, 0.1.0-beta.1)'
required: true
type: string
conan_release:
description: 'Create a release'
required: false
default: true
type: boolean
conan_user_channel:
description: 'Conan user and channel (_/_, ultimaker/testing, internal/testings)'
required: false
default: '_/_'
type: string
conan_internal:
description: 'UltiMaker private (internal)'
required: false
default: false
type: boolean
conan_latest:
description: 'Create the latest alias'
required: false
default: true
type: boolean
conan_extra_args:
description: 'Conan args: (--require-override)'
required: false
default: ''
type: string
conan_recipe_root:
required: false
default: "."
description: 'location of the conanfile.py defaults to `.`'
type: string
workflow_call:
inputs:
organization:
required: false
default: Ultimaker
type: string
repository:
required: true
type: string
ref_name:
required: false
default: ''
type: string
version:
required: true
type: string
conan_release:
required: false
default: true
type: boolean
conan_user_channel:
required: false
default: '_/_'
type: string
conan_internal:
required: false
default: false
type: boolean
conan_latest:
required: false
default: true
type: boolean
conan_extra_args:
required: false
default: ''
type: string
conan_recipe_root:
required: false
default: "."
type: string
permissions:
contents: read
env:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}
SENTRY_TOKEN: ${{ secrets.CURAENGINE_SENTRY_TOKEN }}
jobs:
package-export:
runs-on: self-hosted-Ubuntu22-X64
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.organization }}/${{ inputs.repository }}
ref: ${{ inputs.ref_name }}
fetch-depth: 1
token: ${{ secrets.CURA_CONAN_PACKAGE_RELEASE_PAT }}
- name: Sync pip requirements
run: |
mkdir -p .github/workflows
cd .github/workflows
curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt
- name: Setup Python and pip
uses: actions/setup-python@v4
with:
python-version: 3.11.x
cache: pip
cache-dependency-path: .github/workflows/requirements-runner.txt
- name: Install Python requirements and Create default Conan profile
run: pip install -r .github/workflows/requirements-runner.txt
- name: Setup pipeline caches
run: |
mkdir -p /home/runner/.conan/downloads
- name: Create default Conan profile
run: conan profile new default --detect --force
- name: Get Conan configuration
run: |
conan config install https://github.com/Ultimaker/conan-config.git
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
- name: Add Cura private Artifactory remote
if: ${{ inputs.conan_internal }}
run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/internal"
- name: Cache Conan downloads
uses: actions/cache@v3
with:
path: /home/runner/.conan/downloads
key: ${{ runner.os }}-conan-downloads-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-conan-downloads-
- name: Install pyyaml
run: pip install pyyaml
- name: Get basic project info
run: |
echo "CONAN_PROJECT_NAME=$(conan inspect ${{ inputs.conan_recipe_root }} | awk '/^name:/ {print $2}')" >> $GITHUB_ENV
- id: get-conan-broadcast-data
name: Get Conan broadcast data
run: |
mkdir runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/get_conan_broadcast_data.py -O runner_scripts/get_conan_broadcast_data.py
python runner_scripts/get_conan_broadcast_data.py --user_channel ${{ inputs.conan_user_channel }} --project_name $CONAN_PROJECT_NAME --release ${{ inputs.conan_release }} --version ${{ inputs.version }}
- name: Install system requirements for building
run: |
mkdir -p runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh -O runner_scripts/ubuntu_setup.sh
chmod +x runner_scripts/ubuntu_setup.sh
sudo ./runner_scripts/ubuntu_setup.sh
- id: export-package
name: Export the Package
if: ${{ inputs.conan_recipe_root != '.' || (inputs.repository != 'Cura' && inputs.repository!='Uranium') }}
run: conan export ${{ inputs.conan_recipe_root }} ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }}
- name: Create conan for Uranium and Cura
if: ${{ steps.export-package.conclusion == 'skipped' }}
run: conan create . ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }} --build=missing --update -o cura:devtools=True -o *:enable_i18n=True -c user.i18n:options="{'extract':True,'build':True}"
- name: Create the latest alias
if: ${{ inputs.conan_latest }}
run: conan alias ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }}
- name: Upload the Package(s)
if: ${{ ! inputs.conan_internal }}
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} -r cura --all -c
- name: Upload the latest Package(s)
if: ${{ ! inputs.conan_internal && inputs.conan_latest }}
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura -c
- name: Upload the Package(s) to the private Artifactory
if: ${{ inputs.conan_internal }}
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} -r cura-private --all -c
- name: Upload the latest Package(s) to the private Artifactory
if: ${{ inputs.conan_internal && inputs.conan_latest }}
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura-private -c