-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (93 loc) · 3.6 KB
/
conan-recipe-export.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
name: Export Conan Recipe to server
on:
workflow_call:
inputs:
recipe_id_name:
required: true
type: string
recipe_id_version:
required: true
type: string
recipe_id_user:
required: true
type: string
recipe_id_channel:
required: true
type: string
recipe_id_full:
required: true
type: string
conan_internal:
required: false
default: false
type: boolean
conan_extra_args:
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: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
- name: Checkout repo PR
uses: actions/checkout@v4
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
with:
fetch-depth: 1
ref: ${{ github.base_ref }}
# FIXME: use main once merged
- name: Sync pip requirements
run: wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/CURA-11622_conan_v2/.github/workflows/requirements-runner.txt -O .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/.conan2/p
- name: Create default Conan profile
run: conan profile detect -f
# FIXME: use runner.os/runner.arch after merge: conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
- name: Get Conan configuration
run: |
conan config install https://github.com/Ultimaker/conan-config.git -a "-b CURA-11622_conan_v2"
# conan remote disable cura-private
conan remote login -p ${{ secrets.CONAN_PASS }} cura-conan-v2 ${{ secrets.CONAN_USER }}
- name: Add Cura private Artifactory remote
if: ${{ inputs.conan_internal }}
run: |
conan remote enable cura-private
conan remote login -p ${{ secrets.CONAN_PASS }} cura-private ${{ secrets.CONAN_USER }}
- name: Cache Conan
uses: actions/cache@v3
with:
path: /home/runner/.conan2/p
key: ${{ runner.os }}-conan-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-conan-
- name: Export the Package
run: conan export . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }}
- name: Upload the Package(s)
if: ${{ always() && !inputs.conan_internal}}
run: |
conan upload ${{ inputs.recipe_id_full }} -r cura-conan-v2 --all -c
- name: Upload the Package(s) to the private Artifactory
if: ${{ always() && inputs.conan_internal }}
run: |
conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c