-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Conan, JFrog and GitHub Actions to build and manage Cura (and her dependencies #12708
Changes from 250 commits
705231d
da00707
0cea013
cdc8fd7
8761a47
7700d01
5a61c4e
aa43287
32ed061
91cd709
2335322
8724c8c
f4ee4ad
a5d70dc
a8a2fd8
257056a
67d08fd
a42a151
b147742
5062d70
ff3a422
1bb1efd
2cee093
ed3f342
a2413f4
f745ab7
a837827
eae1394
ddb8765
e0c319e
d47635c
6b51753
795814d
d20976d
970e0d8
254edfd
f3fd2d6
648c1e9
d07c9d6
a62e5ec
f4b3256
f2717d1
fab86be
5c1b665
394942e
c2f3161
047d7b1
72b1097
a2da68d
afa899c
724f2ab
5c0f416
2739057
12379b1
b4f3d5c
77a72fc
c08aa5b
5858349
e069946
83bad98
cf1e2bd
21e69a8
c4aee2a
6047c10
36bcb97
7dc4266
f6ca16a
e570e3b
cc8f0d3
055eda2
e9cbad1
9801402
dc8c9bb
721aff4
2ea78a3
3fe0f26
f3ebf98
87a5211
f578943
dec5609
7bc7107
e90f751
1f629b9
627bd92
5d057db
5b771e3
b6676e7
ff32140
9839393
b5e0ae8
ac2fbbf
ffd6644
61d276f
0580814
cf90334
4ed1688
085868d
f2fa309
2fd1309
cbedbbb
f4cad7f
a9f4d70
578e996
6693354
8b8220c
65460a7
7c1d280
b35a8bf
0aa65cc
66a38be
8a3d94d
4b54762
42b5aa4
0f5e0a8
da14603
5e8b137
ca36b4f
3dc6468
bbcba0c
e843849
7ae1b2a
79e5950
e6855ad
4316ad0
6a712c5
e3517a8
6792490
d13c037
1b96480
d449f56
1aa67b7
a56c782
b0286cb
253e61c
dee54c4
2cc6cc7
1c19230
1ddc6c6
fd55ec7
6df5072
2a4c8aa
87e304a
5bc6132
3d422e1
cd288f3
08c11f0
e226dc5
b1af3b6
54f9384
d91b93b
d7f103c
f01f978
f4c2163
bafffa9
9051041
16d9dd5
baec0e7
68a7968
fd7c5ab
67d840f
03af1db
8a14406
2ee58e2
4fb7d0e
17d2fb8
bee2b22
feebf6d
44bb953
13d5d33
4344ef0
bfd1c6e
db8ec39
d3b32b5
7405b55
c9587c3
48539bb
b84ee29
c100f68
5191d4f
4d98ba3
15c1b96
5d5c83e
93bcd54
55375a2
df5446b
7ed81f0
d84133c
c16e1fc
dea2247
ab4c62e
c22999c
cbe8a90
593ba0e
82904cc
1c77eb0
8500e34
1066e6a
9c0671f
afed961
ce136fa
4656ba0
c75268d
117e997
0c37fe3
e73a18a
1f1ee7f
6a36840
3cb58c6
ed02364
9b8f4b5
8b5ed4b
8750c21
f9d4628
cda4cdf
70c4125
0d04f3e
f9b7d74
349eac5
eb943f7
6e46d35
23234ea
5f12f1f
1d3693c
0a1452d
4d501e8
ce68620
85d3bb1
7e35a0e
e82cc1c
b482b4d
613d397
43d9174
4fd744c
a1c39c7
0a000a7
90336ce
52636dc
15c6771
6c4e85b
b56b65a
80c3a1d
bedcb8b
6991305
7aebfac
4fdd78e
550d4b8
56659ce
596bfe8
91a830a
c66ea0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Create and Upload Conan package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
recipe_id_full: | ||
required: true | ||
type: string | ||
|
||
runs_on: | ||
required: true | ||
type: string | ||
|
||
python_version: | ||
required: true | ||
type: string | ||
|
||
conan_config_branch: | ||
required: false | ||
type: string | ||
|
||
conan_logging_level: | ||
required: false | ||
type: string | ||
|
||
conan_clean_local_cache: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
env: | ||
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} | ||
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} | ||
CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }} | ||
CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }} | ||
CONAN_LOG_RUN_TO_OUTPUT: 1 | ||
CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }} | ||
CONAN_NON_INTERACTIVE: 1 | ||
|
||
jobs: | ||
conan-package-create: | ||
runs-on: ${{ inputs.runs_on }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python and pip | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python_version }} | ||
cache: 'pip' | ||
cache-dependency-path: .github/workflows/requirements-conan-package.txt | ||
|
||
- name: Install Python requirements and Create default Conan profile | ||
run: | | ||
pip install -r .github/workflows/requirements-conan-package.txt | ||
conan profile new default --detect | ||
|
||
- name: Use Conan download cache (Bash) | ||
if: ${{ runner.os != 'Windows' }} | ||
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" | ||
|
||
- name: Use Conan download cache (Powershell) | ||
if: ${{ runner.os == 'Windows' }} | ||
run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache" | ||
casperlamboo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Cache Conan local repository packages (Bash) | ||
uses: actions/cache@v3 | ||
if: ${{ runner.os != 'Windows' }} | ||
with: | ||
path: | | ||
$HOME/.conan/data | ||
$HOME/.conan/conan_download_cache | ||
key: conan-${{ runner.os }}-${{ runner.arch }} | ||
|
||
- name: Cache Conan local repository packages (Powershell) | ||
uses: actions/cache@v3 | ||
if: ${{ runner.os == 'Windows' }} | ||
with: | ||
path: | | ||
C:\Users\runneradmin\.conan\data | ||
casperlamboo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
C:\.conan | ||
C:\Users\runneradmin\.conan\conan_download_cache | ||
key: conan-${{ runner.os }}-${{ runner.arch }} | ||
|
||
- name: Install MacOS system requirements | ||
if: ${{ runner.os == 'Macos' }} | ||
run: brew install autoconf automake ninja | ||
|
||
- name: Install Linux system requirements | ||
if: ${{ runner.os == 'Linux' }} | ||
run: sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe these dependencies can be stored similar to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not an Ubuntu-man myself if we can store these in a system deps file, then I'm all for it. But I myself don't have a ready made solution for this in mind. Maybe you guys can look into that |
||
|
||
- name: Clean Conan local cache | ||
if: ${{ inputs.conan_clean_local_cache }} | ||
run: conan remove "*" -f | ||
|
||
- name: Get Conan configuration from branch | ||
if: ${{ inputs.conan_config_branch != '' }} | ||
run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}" | ||
|
||
- name: Get Conan configuration | ||
if: ${{ inputs.conan_config_branch == '' }} | ||
run: conan config install https://github.com/Ultimaker/conan-config.git | ||
|
||
- name: Create the Packages | ||
run: conan install ${{ inputs.recipe_id_full }} --build=missing --update | ||
|
||
- name: Upload the Package(s) | ||
if: always() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If creating a package from the current project fails, then we still could have build binaries from depending Conan packages. By ensuring that these are uploaded you will have a quicker subsequent run, were it doesn't need to rebuild those but they can be downloaded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
run: | | ||
conan upload "*" -r cura --all -c | ||
conan upload "*" -r cura-ce -c |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
name: conan-package | ||
|
||
# Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can | ||
# be used downstream. | ||
# | ||
# It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
create_binaries_windows: | ||
required: true | ||
default: false | ||
description: 'create binaries Windows' | ||
create_binaries_linux: | ||
required: true | ||
default: false | ||
description: 'create binaries Linux' | ||
create_binaries_macos: | ||
required: true | ||
default: false | ||
description: 'create binaries Macos' | ||
|
||
push: | ||
paths: | ||
- 'plugins/**' | ||
- 'resources/**' | ||
- 'cura/**' | ||
- 'icons/**' | ||
- 'tests/**' | ||
- 'packaging/**' | ||
- '.github/workflows/conan-*.yml' | ||
- '.github/workflows/notify.yml' | ||
- '.github/workflows/requirements-conan-package.txt' | ||
- 'requirements*.txt' | ||
- 'conanfile.py' | ||
- 'conandata.yml' | ||
- 'GitVersion.yml' | ||
- '*.jinja' | ||
branches: | ||
- main | ||
- 'CURA-*' | ||
- '[1-9]+.[0-9]+' | ||
casperlamboo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+-beta' | ||
|
||
jobs: | ||
conan-recipe-version: | ||
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@CURA-9365 | ||
with: | ||
project_name: cura | ||
|
||
conan-package-export-macos: | ||
needs: [ conan-recipe-version ] | ||
uses: ultimaker/cura/.github/workflows/[email protected] | ||
with: | ||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} | ||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} | ||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }} | ||
runs_on: 'macos-10.15' | ||
python_version: '3.10.4' | ||
conan_config_branch: 'master' | ||
conan_logging_level: 'info' | ||
conan_export_binaries: true | ||
secrets: inherit | ||
|
||
conan-package-export-linux: | ||
needs: [ conan-recipe-version ] | ||
uses: ultimaker/cura/.github/workflows/[email protected] | ||
with: | ||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} | ||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} | ||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }} | ||
runs_on: 'ubuntu-20.04' | ||
python_version: '3.10.4' | ||
conan_config_branch: 'master' | ||
conan_logging_level: 'info' | ||
conan_export_binaries: true | ||
secrets: inherit | ||
|
||
conan-package-export-windows: | ||
needs: [ conan-recipe-version ] | ||
uses: ultimaker/cura/.github/workflows/[email protected] | ||
with: | ||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} | ||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} | ||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }} | ||
runs_on: 'windows-2022' | ||
python_version: '3.10.4' | ||
conan_config_branch: 'master' | ||
conan_logging_level: 'info' | ||
conan_export_binaries: true | ||
secrets: inherit | ||
Joeydelarago marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
notify-export: | ||
if: ${{ always() }} | ||
jellespijker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
needs: [ conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ] | ||
|
||
uses: ultimaker/cura/.github/workflows/[email protected] | ||
with: | ||
success: ${{ contains(join(needs.*.result, ','), 'success') }} | ||
success_title: "New Conan recipe exported in ${{ github.repository }}" | ||
success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" | ||
failure_title: "Failed to export Conan Export in ${{ github.repository }}" | ||
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" | ||
secrets: inherit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Export Conan Recipe to server | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
recipe_id_full: | ||
required: true | ||
type: string | ||
|
||
recipe_id_latest: | ||
required: false | ||
type: string | ||
|
||
recipe_id_pr: | ||
required: false | ||
type: string | ||
|
||
runs_on: | ||
required: true | ||
type: string | ||
|
||
python_version: | ||
required: true | ||
type: string | ||
|
||
conan_config_branch: | ||
required: false | ||
type: string | ||
|
||
conan_logging_level: | ||
required: false | ||
type: string | ||
|
||
conan_export_binaries: | ||
required: false | ||
type: boolean | ||
|
||
env: | ||
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} | ||
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} | ||
CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }} | ||
CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }} | ||
CONAN_LOG_RUN_TO_OUTPUT: 1 | ||
CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }} | ||
CONAN_NON_INTERACTIVE: 1 | ||
|
||
jobs: | ||
package-export: | ||
runs-on: ${{ inputs.runs_on }} | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python and pip | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python_version }} | ||
cache: 'pip' | ||
cache-dependency-path: .github/workflows/requirements-conan-package.txt | ||
|
||
- name: Install Python requirements and Create default Conan profile | ||
run: | | ||
pip install -r .github/workflows/requirements-conan-package.txt | ||
conan profile new default --detect | ||
|
||
- name: Cache Conan local repository packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: $HOME/.conan/data | ||
key: ${{ runner.os }}-conan | ||
|
||
- name: Get Conan configuration from branch | ||
if: ${{ inputs.conan_config_branch != '' }} | ||
run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}" | ||
|
||
- name: Get Conan configuration | ||
if: ${{ inputs.conan_config_branch == '' }} | ||
run: conan config install https://github.com/Ultimaker/conan-config.git | ||
|
||
- name: Export the Package (binaries) | ||
if: ${{ inputs.conan_export_binaries == 'true' }} | ||
run: conan export-pkg . ${{ inputs.recipe_id_full }} | ||
|
||
- name: Export the Package | ||
if: ${{ inputs.conan_export_binaries != 'true' && github.event_name != 'pull_request' }} | ||
run: conan export . ${{ inputs.recipe_id_full }} | ||
|
||
- name: Create the latest alias | ||
if: ${{ inputs.recipe_id_latest != '' && github.event_name != 'pull_request' }} | ||
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }} | ||
|
||
- name: Create the pull request alias | ||
if: ${{ inputs.recipe_id_pr != '' && github.event_name == 'pull_request' }} | ||
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }} | ||
|
||
- name: Upload the Package(s) | ||
run: | | ||
# Only use --all (upload binaries) for the cura repository | ||
conan upload "*" -r cura --all -c | ||
conan upload "*" -r cura-ce -c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use
%HOMEPATH%
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I ran to issues with it early on.
Try changing it, but
If anything we should use the PowerShell env naming scheme:
$Env:<name>
, since Windows uses the PowerShell by default