From 2734005f3688699e5c2c7a82f72369393fa6f8f1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 6 Sep 2022 13:43:14 +0200 Subject: [PATCH 1/8] Add extra BOM numbers to UMs3 and UMs5 --- resources/definitions/ultimaker_s3.def.json | 2 +- resources/definitions/ultimaker_s5.def.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/ultimaker_s3.def.json b/resources/definitions/ultimaker_s3.def.json index 743ab7f478..db5a30f565 100644 --- a/resources/definitions/ultimaker_s3.def.json +++ b/resources/definitions/ultimaker_s3.def.json @@ -35,7 +35,7 @@ "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ - 213482 + 213482, 213483 ] }, diff --git a/resources/definitions/ultimaker_s5.def.json b/resources/definitions/ultimaker_s5.def.json index da0367f571..2cc1bbbf58 100644 --- a/resources/definitions/ultimaker_s5.def.json +++ b/resources/definitions/ultimaker_s5.def.json @@ -36,7 +36,7 @@ "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" }, "bom_numbers": [ - 9051, 214475 + 9051, 214475, 214476 ] }, From e704d4db420707c2852525ac9521cfc55b5884dd Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Tue, 6 Sep 2022 15:02:54 +0200 Subject: [PATCH 2/8] Add 5.1.1 entry to conan_data --- conandata.yml | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/conandata.yml b/conandata.yml index b4fe8f102b..2e13e17369 100644 --- a/conandata.yml +++ b/conandata.yml @@ -102,6 +102,98 @@ Windows: "./icons/Cura.ico" Macos: "./icons/cura.icns" Linux: "./icons/cura-128.png" +"5.1.1": + requirements: + - "arcus/5.1.0" + - "curaengine/5.1.0" + - "savitar/5.1.0" + - "pynest2d/5.1.0" + - "uranium/5.1.0" + - "fdm_materials/5.1.0" + - "cura_binary_data/5.1.0" + - "cpython/3.10.4" + runinfo: + entrypoint: "cura_app.py" + pyinstaller: + datas: + cura_plugins: + package: "cura" + src: "plugins" + dst: "share/cura/plugins" + cura_resources: + package: "cura" + src: "resources" + dst: "share/cura/resources" + uranium_plugins: + package: "uranium" + src: "plugins" + dst: "share/uranium/plugins" + uranium_resources: + package: "uranium" + src: "resources" + dst: "share/uranium/resources" + uranium_um_qt_qml_um: + package: "uranium" + src: "site-packages/UM/Qt/qml/UM" + dst: "PyQt6/Qt6/qml/UM" + cura_binary_data: + package: "cura_binary_data" + src: "resources/cura/resources" + dst: "share/cura/resources" + uranium_binary_data: + package: "cura_binary_data" + src: "resources/uranium/resources" + dst: "share/uranium/resources" + windows_binary_data: + package: "cura_binary_data" + src: "windows" + dst: "share/windows" + fdm_materials: + package: "fdm_materials" + src: "materials" + dst: "share/cura/resources/materials" + tcl: + package: "tcl" + src: "lib/tcl8.6" + dst: "tcl" + tk: + package: "tk" + src: "lib/tk8.6" + dst: "tk" + binaries: + curaengine: + package: "curaengine" + src: "bin" + dst: "." + binary: "CuraEngine" + hiddenimports: + - "pySavitar" + - "pyArcus" + - "pynest2d" + - "PyQt6" + - "PyQt6.QtNetwork" + - "PyQt6.sip" + - "logging.handlers" + - "zeroconf" + - "fcntl" + - "stl" + - "serial" + collect_all: + - "cura" + - "UM" + - "serial" + - "Charon" + - "sqlite3" + - "trimesh" + - "win32ctypes" + - "PyQt6" + - "PyQt6.QtNetwork" + - "PyQt6.sip" + - "stl" + icon: + Windows: "./icons/Cura.ico" + Macos: "./icons/cura.icns" + Linux: "./icons/cura-128.png" "5.1.0": requirements: - "arcus/5.1.0" From e164efeca43ffbd601de46003355f4f989f17797 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Tue, 6 Sep 2022 15:16:17 +0200 Subject: [PATCH 3/8] Use conanfile fixes from main --- conandata.yml | 92 ------------------ conanfile.py | 118 ++++++++++++++++++------ packaging/NSIS/Ultimaker-Cura.nsi.jinja | 2 +- 3 files changed, 91 insertions(+), 121 deletions(-) diff --git a/conandata.yml b/conandata.yml index 2e13e17369..673e530f9c 100644 --- a/conandata.yml +++ b/conandata.yml @@ -10,98 +10,6 @@ # requirements (use the /(latest)@ultimaker/testing) # # Subject to change in the future! -"None": - requirements: - - "arcus/5.1.0" - - "curaengine/(latest)@ultimaker/testing" - - "savitar/5.1.0" - - "pynest2d/5.1.0" - - "uranium/(latest)@ultimaker/testing" - - "fdm_materials/(latest)@ultimaker/testing" - - "cura_binary_data/(latest)@ultimaker/testing" - - "cpython/3.10.4" - runinfo: - entrypoint: "cura_app.py" - pyinstaller: - datas: - cura_plugins: - package: "cura" - src: "plugins" - dst: "share/cura/plugins" - cura_resources: - package: "cura" - src: "resources" - dst: "share/cura/resources" - uranium_plugins: - package: "uranium" - src: "plugins" - dst: "share/uranium/plugins" - uranium_resources: - package: "uranium" - src: "resources" - dst: "share/uranium/resources" - uranium_um_qt_qml_um: - package: "uranium" - src: "site-packages/UM/Qt/qml/UM" - dst: "PyQt6/Qt6/qml/UM" - cura_binary_data: - package: "cura_binary_data" - src: "resources/cura/resources" - dst: "share/cura/resources" - uranium_binary_data: - package: "cura_binary_data" - src: "resources/uranium/resources" - dst: "share/uranium/resources" - windows_binary_data: - package: "cura_binary_data" - src: "windows" - dst: "share/windows" - fdm_materials: - package: "fdm_materials" - src: "materials" - dst: "share/cura/resources/materials" - tcl: - package: "tcl" - src: "lib/tcl8.6" - dst: "tcl" - tk: - package: "tk" - src: "lib/tk8.6" - dst: "tk" - binaries: - curaengine: - package: "curaengine" - src: "bin" - dst: "." - binary: "CuraEngine" - hiddenimports: - - "pySavitar" - - "pyArcus" - - "pynest2d" - - "PyQt6" - - "PyQt6.QtNetwork" - - "PyQt6.sip" - - "logging.handlers" - - "zeroconf" - - "fcntl" - - "stl" - - "serial" - collect_all: - - "cura" - - "UM" - - "serial" - - "Charon" - - "sqlite3" - - "trimesh" - - "win32ctypes" - - "PyQt6" - - "PyQt6.QtNetwork" - - "PyQt6.sip" - - "stl" - icon: - Windows: "./icons/Cura.ico" - Macos: "./icons/cura.icns" - Linux: "./icons/cura-128.png" "5.1.1": requirements: - "arcus/5.1.0" diff --git a/conanfile.py b/conanfile.py index 0d0dbac3d1..c5f584ed16 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,20 +1,15 @@ import os -import sys from pathlib import Path -from io import StringIO - -from platform import python_version - from jinja2 import Template -from conans import tools from conan import ConanFile -from conan.tools import files -from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, rmdir, save +from conan.tools.env import VirtualRunEnv, Environment +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.50.0" class CuraConan(ConanFile): @@ -31,7 +26,7 @@ class CuraConan(ConanFile): # FIXME: Remove specific branch once merged to main # Extending the conanfile with the UMBaseConanfile https://github.com/Ultimaker/conan-ultimaker-index/tree/CURA-9177_Fix_CI_CD/recipes/umbase - python_requires = "umbase/0.1.5@ultimaker/testing" + python_requires = "umbase/[>=0.1.7]@ultimaker/stable" python_requires_extend = "umbase.UMBaseConanfile" options = { @@ -40,7 +35,8 @@ class CuraConan(ConanFile): "devtools": [True, False], # FIXME: Split this up in testing and (development / build (pyinstaller) / system installer) tools "cloud_api_version": "ANY", "display_name": "ANY", # TODO: should this be an option?? - "cura_debug_mode": [True, False] # FIXME: Use profiles + "cura_debug_mode": [True, False], # FIXME: Use profiles + "internal": [True, False] } default_options = { "enterprise": "False", @@ -48,7 +44,8 @@ class CuraConan(ConanFile): "devtools": False, "cloud_api_version": "1", "display_name": "Ultimaker Cura", - "cura_debug_mode": False # Not yet implemented + "cura_debug_mode": False, # Not yet implemented + "internal": False, } scm = { "type": "git", @@ -57,6 +54,28 @@ class CuraConan(ConanFile): "revision": "auto" } + @property + def _pycharm_targets(self): + return self.conan_data["pycharm_targets"] + + # FIXME: These env vars should be defined in the runenv. + _cura_env = None + + @property + def _cura_run_env(self): + if self._cura_env: + return self._cura_env + + self._cura_env = Environment() + self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml"))) + self._cura_env.define("QT_PLUGIN_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "plugins"))) + + if self.settings.os == "Linux": + self._cura_env.define("QT_QPA_FONTDIR", "/usr/share/fonts") + self._cura_env.define("QT_QPA_PLATFORMTHEME", "xdgdesktopportal") + self._cura_env.define("QT_XKB_CONFIG_ROOT", "/usr/share/X11/xkb") + return self._cura_env + @property def _staging(self): return self.options.staging in ["True", 'true'] @@ -81,6 +100,10 @@ class CuraConan(ConanFile): def _digital_factory_url(self): return "https://digitalfactory-staging.ultimaker.com" if self._staging else "https://digitalfactory.ultimaker.com" + @property + def _cura_latest_url(self): + return "https://software.ultimaker.com/latest.json" + @property def requirements_txts(self): if self.options.devtools: @@ -93,8 +116,10 @@ class CuraConan(ConanFile): if self.build_folder is not None: return Path(self.build_folder) return Path(os.getcwd(), "venv") - - return Path(self.install_folder) # TODO: add base dir for running from source + if self.in_local_cache: + return Path(self.install_folder) + else: + return Path(self.source_folder, "venv") @property def _share_dir(self): @@ -110,7 +135,7 @@ class CuraConan(ConanFile): def _site_packages(self): if self.settings.os == "Windows": return self._base_dir.joinpath("Lib", "site-packages") - py_version = tools.Version(self.deps_cpp_info["cpython"].version) + py_version = Version(self.deps_cpp_info["cpython"].version) return self._base_dir.joinpath("lib", f"python{py_version.major}.{py_version.minor}", "site-packages") @property @@ -124,23 +149,32 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("CuraVersion.py.jinja"), "r") as f: cura_version_py = Template(f.read()) + cura_version = self.version + if self.options.internal: + version = Version(self.version) + cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.prerelease.replace('+', '+internal_')}" + with open(Path(location, "CuraVersion.py"), "w") as f: f.write(cura_version_py.render( cura_app_name = self.name, cura_app_display_name = self.options.display_name, - cura_version = self.version, + cura_version = cura_version, cura_build_type = "Enterprise" if self._enterprise else "", cura_debug_mode = self.options.cura_debug_mode, cura_cloud_api_root = self._cloud_api_root, cura_cloud_api_version = self.options.cloud_api_version, cura_cloud_account_api_root = self._cloud_account_api_root, cura_marketplace_root = self._marketplace_root, - cura_digital_factory_url = self._digital_factory_url)) + cura_digital_factory_url = self._digital_factory_url, + cura_latest_url = self._cura_latest_url)) def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, entitlements_file): pyinstaller_metadata = self._um_data()["pyinstaller"] datas = [(str(self._base_dir.joinpath("conan_install_info.json")), ".")] for data in pyinstaller_metadata["datas"].values(): + if not self.options.internal and data.get("internal", False): + continue + if "package" in data: # get the paths from conan package if data["package"] == self.name: if self.in_local_cache: @@ -186,7 +220,7 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("Ultimaker-Cura.spec.jinja"), "r") as f: pyinstaller = Template(f.read()) - cura_version = tools.Version(self.version) if self.version else tools.Version("0.0.0") + cura_version = Version(self.version) if self.version else Version("0.0.0") with open(Path(location, "Ultimaker-Cura.spec"), "w") as f: f.write(pyinstaller.render( @@ -209,22 +243,26 @@ class CuraConan(ConanFile): short_version = f"'{cura_version.major}.{cura_version.minor}.{cura_version.patch}'", )) - def source(self): - self._generate_cura_version(Path(self.source_folder, "cura")) + def set_version(self): + if self.version is None: + self.version = self._umdefault_version() def configure(self): - self.options["arcus"].shared = True - self.options["savitar"].shared = True + self.options["pyarcus"].shared = True + self.options["pysavitar"].shared = True self.options["pynest2d"].shared = True self.options["cpython"].shared = True def validate(self): - if self.version and tools.Version(self.version) <= tools.Version("4"): + if self.version and Version(self.version) <= Version("4"): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): for req in self._um_data()["requirements"]: self.requires(req) + if self.options.internal: + for req in self._um_data()["internal_requirements"]: + self.requires(req) def layout(self): self.folders.source = "." @@ -235,10 +273,19 @@ class CuraConan(ConanFile): self.cpp.package.bindirs = ["bin"] self.cpp.package.resdirs = ["resources", "plugins", "packaging", "pip_requirements"] # pip_requirements should be the last item in the list + def build(self): + pass + def generate(self): + cura_run_envvars = self._cura_run_env.vars(self, scope = "run") + ext = ".ps1" if self.settings.os == "Windows" else ".sh" + cura_run_envvars.save_script(self.folders.generators.joinpath(f"cura_run_environment{ext}")) + vr = VirtualRunEnv(self) vr.generate() + self._generate_cura_version(Path(self.source_folder, "cura")) + if self.options.devtools: entitlements_file = "'{}'".format(Path(self.source_folder, "packaging", "dmg", "cura.entitlements")) self._generate_pyinstaller_spec(location = self.generators_folder, @@ -250,15 +297,21 @@ class CuraConan(ConanFile): self.copy("CuraEngine.exe", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) self.copy("CuraEngine", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) - files.rmdir(self, "resources/materials") + rmdir(self, os.path.join(self.source_folder, "resources", "materials")) self.copy("*.fdm_material", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) self.copy("*.sig", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) + if self.options.internal: + self.copy("*.fdm_material", root_package = "fdm_materials_private", src = "@resdirs", dst = "resources/materials", keep_path = False) + self.copy("*.sig", root_package = "fdm_materials_private", src = "@resdirs", dst = "resources/materials", keep_path = False) + self.copy("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0], + dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) + # Copy resources of cura_binary_data self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[0], - dst = "venv/share/cura", keep_path = True) + dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[1], - dst = "venv/share/uranium", keep_path = True) + dst =self._share_dir.joinpath("uranium", "resources"), keep_path = True) self.copy("*.dll", src = "@bindirs", dst = self._site_packages) self.copy("*.pyd", src = "@libdirs", dst = self._site_packages) @@ -286,6 +339,15 @@ class CuraConan(ConanFile): self.copy_deps("*.sig", root_package = "fdm_materials", src = self.deps_cpp_info["fdm_materials"].resdirs[0], dst = self._share_dir.joinpath("cura", "resources", "materials"), keep_path = False) + # Copy internal resources + if self.options.internal: + self.copy_deps("*.fdm_material", root_package = "fdm_materials_private", src = self.deps_cpp_info["fdm_materials_private"].resdirs[0], + dst = self._share_dir.joinpath("cura", "resources", "materials"), keep_path = False) + self.copy_deps("*.sig", root_package = "fdm_materials_private", src = self.deps_cpp_info["fdm_materials_private"].resdirs[0], + dst = self._share_dir.joinpath("cura", "resources", "materials"), keep_path = False) + self.copy_deps("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0], + dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) + # Copy resources of Uranium (keep folder structure) self.copy_deps("*", root_package = "uranium", src = self.deps_cpp_info["uranium"].resdirs[0], dst = self._share_dir.joinpath("uranium", "resources"), keep_path = True) @@ -319,7 +381,7 @@ class CuraConan(ConanFile): self.copy("*.txt", src = self.cpp_info.resdirs[-1], dst = self._base_dir.joinpath("pip_requirements")) # Generate the GitHub Action version info Environment - cura_version = tools.Version(self.version) + cura_version = Version(self.version) env_prefix = "Env:" if self.settings.os == "Windows" else "" activate_github_actions_version_env = Template(r"""echo "CURA_VERSION_MAJOR={{ cura_version_major }}" >> ${{ env_prefix }}GITHUB_ENV echo "CURA_VERSION_MINOR={{ cura_version_minor }}" >> ${{ env_prefix }}GITHUB_ENV @@ -334,7 +396,7 @@ echo "CURA_VERSION_FULL={{ cura_version_full }}" >> ${{ env_prefix }}GITHUB_ENV env_prefix = env_prefix) ext = ".sh" if self.settings.os != "Windows" else ".ps1" - files.save(self, self._script_dir.joinpath(f"activate_github_actions_version_env{ext}"), activate_github_actions_version_env) + save(self, self._script_dir.joinpath(f"activate_github_actions_version_env{ext}"), activate_github_actions_version_env) self._generate_cura_version(Path(self._site_packages, "cura")) diff --git a/packaging/NSIS/Ultimaker-Cura.nsi.jinja b/packaging/NSIS/Ultimaker-Cura.nsi.jinja index 70fa93e608..9a51b81110 100644 --- a/packaging/NSIS/Ultimaker-Cura.nsi.jinja +++ b/packaging/NSIS/Ultimaker-Cura.nsi.jinja @@ -12,7 +12,7 @@ !define INSTALLER_NAME "{{ destination }}" !define MAIN_APP_EXE "{{ main_app }}" !define INSTALL_TYPE "SetShellVarContext all" -!define REG_ROOT "HKCU" +!define REG_ROOT "HKCR" !define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}" !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" From 2086bbfc49aa161c5afaa0d33a58efe6096fb8e4 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Tue, 6 Sep 2022 15:25:18 +0200 Subject: [PATCH 4/8] Use workflow fixes from main --- .github/workflows/conan-package-create.yml | 61 ++++++++++--- .github/workflows/conan-package.yml | 52 ++++++----- .github/workflows/conan-recipe-export.yml | 37 ++++---- .github/workflows/conan-recipe-version.yml | 89 ++++++++++++++----- .github/workflows/cura-installer.yml | 46 ++++++---- .../workflows/requirements-conan-package.txt | 4 +- .github/workflows/unit-test.yml | 13 ++- 7 files changed, 203 insertions(+), 99 deletions(-) diff --git a/.github/workflows/conan-package-create.yml b/.github/workflows/conan-package-create.yml index b0e613493c..4af608b7ac 100644 --- a/.github/workflows/conan-package-create.yml +++ b/.github/workflows/conan-package-create.yml @@ -7,6 +7,10 @@ on: required: true type: string + recipe_id_latest: + required: false + type: string + runs_on: required: true type: string @@ -28,6 +32,16 @@ on: type: boolean default: false + conan_upload_community: + required: false + default: true + type: boolean + + create_from_source: + required: false + default: false + type: boolean + env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} @@ -52,10 +66,8 @@ jobs: 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: Install Python requirements for runner + run: pip install -r .github/workflows/requirements-conan-package.txt - name: Use Conan download cache (Bash) if: ${{ runner.os != 'Windows' }} @@ -90,11 +102,21 @@ jobs: - 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 pkg-config -y + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt update + sudo apt upgrade + 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 pkg-config -y - - name: Clean Conan local cache - if: ${{ inputs.conan_clean_local_cache }} - run: conan remove "*" -f + - name: Install GCC-12 on ubuntu-22.04 + if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }} + run: | + sudo apt install g++-12 gcc-12 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 + + - name: Create the default Conan profile + run: conan profile new default --detect - name: Get Conan configuration from branch if: ${{ inputs.conan_config_branch != '' }} @@ -105,10 +127,27 @@ jobs: run: conan config install https://github.com/Ultimaker/conan-config.git - name: Create the Packages + if: ${{ !inputs.create_from_source }} run: conan install ${{ inputs.recipe_id_full }} --build=missing --update + - name: Create the Packages (from source) + if: ${{ inputs.create_from_source }} + run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update + + - name: Remove the latest alias + if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && runner.os == 'Linux' }} + run: | + conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true + conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true + + - name: Create the latest alias + if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && always() }} + run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }} + - name: Upload the Package(s) if: always() - run: | - conan upload "*" -r cura --all -c - conan upload "*" -r cura-ce -c + run: conan upload "*" -r cura --all -c + + - name: Upload the Package(s) community + if: ${{ always() && inputs.conan_upload_community == true }} + run: conan upload "*" -r cura-ce -c diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 666ea5fe40..d7f4557b81 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -41,10 +41,11 @@ on: branches: - main - 'CURA-*' - - '[1-9]+.[0-9]+' + - '[1-9].[0-9]' + - '[1-9].[0-9][0-9]' tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+-beta' + - '[1-9].[0-9].[0-9]+' + - '[1-9].[0-9][0-9].[0-9]+' jobs: conan-recipe-version: @@ -52,48 +53,32 @@ jobs: with: project_name: cura - conan-package-export-macos: + conan-package-export: needs: [ conan-recipe-version ] uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main 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.x' - conan_logging_level: 'info' - conan_export_binaries: true - secrets: inherit - - conan-package-export-linux: - needs: [ conan-recipe-version ] - uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main - 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.x' conan_logging_level: 'info' - conan_export_binaries: true secrets: inherit - conan-package-export-windows: - needs: [ conan-recipe-version ] - uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main + conan-package-create-linux: + if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }} + needs: [ conan-recipe-version, conan-package-export ] + + uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main 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' + runs_on: 'ubuntu-20.04' python_version: '3.10.x' conan_logging_level: 'info' - conan_export_binaries: true secrets: inherit notify-export: if: ${{ always() }} - needs: [ conan-recipe-version, conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ] + needs: [ conan-recipe-version, conan-package-export ] uses: ultimaker/cura/.github/workflows/notify.yml@main with: @@ -103,3 +88,16 @@ jobs: 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 + + notify-create: + if: ${{ always() && ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }} + needs: [ conan-recipe-version, conan-package-create-linux ] + + uses: ultimaker/cura/.github/workflows/notify.yml@main + with: + success: ${{ contains(join(needs.*.result, ','), 'success') }} + success_title: "New binaries created in ${{ github.repository }}" + success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" + failure_title: "Failed to create binaries in ${{ github.repository }}" + failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" + secrets: inherit diff --git a/.github/workflows/conan-recipe-export.yml b/.github/workflows/conan-recipe-export.yml index 9adca8ebb3..f38c0046c9 100644 --- a/.github/workflows/conan-recipe-export.yml +++ b/.github/workflows/conan-recipe-export.yml @@ -11,10 +11,6 @@ on: required: false type: string - recipe_id_pr: - required: false - type: string - runs_on: required: true type: string @@ -35,6 +31,11 @@ on: required: false type: boolean + conan_upload_community: + required: false + default: true + type: boolean + env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} @@ -79,23 +80,27 @@ jobs: 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 }} + if: ${{ inputs.conan_export_binaries }} + run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update - name: Export the Package - if: ${{ inputs.conan_export_binaries != 'true' && github.event_name != 'pull_request' }} + if: ${{ !inputs.conan_export_binaries }} 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: Remove the latest alias + if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }} + run: | + conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true + conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true - - name: Create the pull request alias - if: ${{ inputs.recipe_id_pr != '' && github.event_name == 'pull_request' }} + - name: Create the latest alias + if: ${{ inputs.recipe_id_latest != '' && always() }} 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 + if: always() + run: conan upload "*" -r cura --all -c + + - name: Upload the Package(s) community + if: ${{ always() && inputs.conan_upload_community == true }} + run: conan upload "*" -r cura-ce -c diff --git a/.github/workflows/conan-recipe-version.yml b/.github/workflows/conan-recipe-version.yml index 243ebf490f..3e86c880a6 100644 --- a/.github/workflows/conan-recipe-version.yml +++ b/.github/workflows/conan-recipe-version.yml @@ -7,6 +7,11 @@ on: required: true type: string + additional_buildmetadata: + required: false + default: "" + type: string + outputs: recipe_id_full: description: "The full Conan recipe id: /@/" @@ -20,6 +25,10 @@ on: description: "The full semver ..-+" value: ${{ jobs.get-semver.outputs.semver_full }} + is_release_branch: + description: "is current branch a release branch?" + value: ${{ jobs.get-semver.outputs.release_branch }} + recipe_user: description: "The conan user" value: ${{ jobs.get-semver.outputs.user }} @@ -37,15 +46,25 @@ jobs: recipe_id_full: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} recipe_id_latest: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} semver_full: ${{ steps.get-conan-broadcast-data.outputs.semver_full }} + is_release_branch: ${{ steps.get-conan-broadcast-data.outputs.is_release_branch }} user: ${{ steps.get-conan-broadcast-data.outputs.user }} channel: ${{ steps.get-conan-broadcast-data.outputs.channel }} steps: - name: Checkout repo uses: actions/checkout@v3 + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} with: + fetch-depth: 0 ref: ${{ github.head_ref }} - fetch-depth: 3000 + + - name: Checkout repo PR + uses: actions/checkout@v3 + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Setup Python and pip uses: actions/setup-python@v4 @@ -73,24 +92,30 @@ jobs: event_name = "${{ github.event_name }}" issue_number = "${{ github.ref }}".split('/')[2] is_tag = "${{ github.ref_type }}" == "tag" + is_release_branch = False + buildmetadata = "" if "${{ inputs.additional_buildmetadata }}" == "" else "${{ inputs.additional_buildmetadata }}_" # FIXME: for when we push a tag (such as an release) + channel = "testing" if is_tag: branch_version = tools.Version("${{ github.ref_name }}") + is_release_branch = True + channel = "_" + user = "_" else: try: branch_version = tools.Version(repo.active_branch.name) - channel = "stable" except ConanException: branch_version = tools.Version('0.0.0') - if repo.active_branch.name == f"{branch_version.major}.{branch_version.minor}": + if "${{ github.ref_name }}" == f"{branch_version.major}.{branch_version.minor}": channel = 'stable' - elif repo.active_branch.name == "main" or repo.active_branch.name == "master": + is_release_branch = True + elif "${{ github.ref_name }}" in ("main", "master"): channel = 'testing' else: channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower() - if event_name == "pull_request": + if "pull_request" in event_name: channel = f"pr_{issue_number}" # %% Get the actual version @@ -105,27 +130,40 @@ jobs: latest_branch_version = version latest_branch_tag = repo.tag(tag) - # %% Get the actual version - no_commits = 0 - for commit in repo.iter_commits("HEAD"): - if commit == latest_branch_tag.commit: - break - no_commits += 1 - - if no_commits == 0: - # This is a release - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}" - if channel == "stable": - user = "_" - channel = "_" - else: - if event_name == "pull_request": - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+pr_{issue_number}_{no_commits}" + if latest_branch_tag: + # %% Get the actual version + no_commits = 0 + for commit in repo.iter_commits("HEAD"): + if commit == latest_branch_tag.commit: + break + no_commits += 1 + + if no_commits == 0: + # This is a release + actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}" + if channel == "stable": + user = "_" + channel = "_" else: - if latest_branch_version.prerelease == "": - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-alpha+{no_commits}" + if latest_branch_version.prerelease and not "." in latest_branch_version.prerelease: + # The prerealese did not contain a version number, default it to 1 + latest_branch_version.prerelease += ".1" + if event_name == "pull_request": + actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}" else: - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{no_commits}" + if channel in ("stable", "_", ""): + channel_metadata = f"{no_commits}" + else: + channel_metadata = f"{channel}_{no_commits}" + # FIXME: for when we create a new release branch + if latest_branch_version.prerelease == "": + bump_up_minor = int(latest_branch_version.minor) + 1 + actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{latest_branch_version.patch}-alpha+{buildmetadata}{channel_metadata}" + else: + actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}{channel_metadata}" + else: + # FIXME: for external PR's + actual_version = f"5.2.0-alpha+{buildmetadata}pr_{issue_number}" # %% print to output cmd_name = ["echo", f"::set-output name=name::{project_name}"] @@ -140,6 +178,8 @@ jobs: subprocess.call(cmd_id_latest) cmd_semver_full = ["echo", f"::set-output name=semver_full::{actual_version}"] subprocess.call(cmd_semver_full) + cmd_is_release_branch = ["echo", f"::set-output name=is_release_branch::{str(is_release_branch).lower()}"] + subprocess.call(cmd_is_release_branch) print("::group::Conan Recipe Information") print(f"name = {project_name}") @@ -149,5 +189,6 @@ jobs: print(f"recipe_id_full = {project_name}/{actual_version}@{user}/{channel}") print(f"recipe_id_latest = {project_name}/latest@{user}/{channel}") print(f"semver_full = {actual_version}") + print(f"is_release_branch = {str(is_release_branch).lower()}") print("::endgroup::") shell: python diff --git a/.github/workflows/cura-installer.yml b/.github/workflows/cura-installer.yml index b633d49474..10e7888029 100644 --- a/.github/workflows/cura-installer.yml +++ b/.github/workflows/cura-installer.yml @@ -5,11 +5,10 @@ on: inputs: cura_conan_version: description: 'Cura Conan Version' - # Fixme: default to cura/latest@testing (which is main) - default: 'cura/latest@ultimaker/stable' + default: 'cura/latest@ultimaker/testing' required: true conan_args: - description: 'Conan args: eq.: --require-override=curaengine/5.1.0-beta+123@ultimaker/testing' + description: 'Conan args: eq.: --require-override' default: '' required: false conan_config: @@ -62,10 +61,10 @@ jobs: fail-fast: false matrix: include: - - { os: macos-10.15, os_id: 'MacOS' } - - { os: windows-2022, os_id: 'Windows' } - - { os: ubuntu-20.04, os_id: 'Linux' } - - { os: ubuntu-22.04, os_id: 'Linux-latest' } + - { os: macos-11, os_id: 'mac' } + - { os: windows-2022, os_id: 'win64' } + - { os: ubuntu-20.04, os_id: 'linux' } + - { os: ubuntu-22.04, os_id: 'linux-modern' } steps: - name: Checkout @@ -78,10 +77,8 @@ jobs: 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: Install Python requirements for runner + run: pip install -r .github/workflows/requirements-conan-package.txt - name: Use Conan download cache (Bash) if: ${{ runner.os != 'Windows' }} @@ -117,11 +114,24 @@ jobs: - name: Install Linux system requirements if: ${{ runner.os == 'Linux' }} run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt update + sudo apt upgrade 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 pkg-config -y wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool chmod +x $GITHUB_WORKSPACE/appimagetool echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV + - name: Install GCC-12 on ubuntu-22.04 + if: ${{ matrix.os == 'ubuntu-22.04' }} + run: | + sudo apt install g++-12 gcc-12 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 + + - name: Create the default Conan profile + run: conan profile new default --detect + - name: Configure GPG Key Linux (Bash) if: ${{ runner.os == 'Linux' }} run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import @@ -192,34 +202,34 @@ jobs: - name: Archive the artifacts (bash) if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }} - run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/" + run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.tar.gz" "./Ultimaker-Cura/" working-directory: dist - name: Archive the artifacts (Powershell) if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }} - run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.zip" + run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.zip" working-directory: dist - name: Create the Windows exe installer (Powershell) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }} run: | - python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.exe" + python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.exe" working-directory: dist - name: Create the Linux AppImage (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }} - run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.AppImage" + run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.AppImage" working-directory: dist - name: Create the MacOS dmg (Bash) if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }} - run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.dmg" + run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.dmg" working-directory: dist - name: Upload the artifacts uses: actions/upload-artifact@v3 with: - name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}-${{ runner.arch }} + name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }} path: | dist/*.tar.gz dist/*.zip @@ -228,7 +238,7 @@ jobs: dist/*.dmg dist/*.AppImage dist/*.asc - retention-days: 2 + retention-days: 5 notify-export: if: ${{ always() }} diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index c6b564e450..bd19974dd9 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan -sip==6.5.1 +conan!=1.51.0,!=1.51.1,!=1.51.2,!=1.51.3,!=1.52.0 +sip diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 20ea83bdb1..eb2edc09d8 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -103,7 +103,18 @@ jobs: - 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 + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt update + sudo apt upgrade + 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 pkg-config -y + + - name: Install GCC-12 on ubuntu-22.04 + if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }} + run: | + sudo apt install g++-12 gcc-12 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 - name: Get Conan configuration run: conan config install https://github.com/Ultimaker/conan-config.git From 656238d5f27c772cc69bad8180f03888c25a51cc Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Tue, 6 Sep 2022 16:54:49 +0200 Subject: [PATCH 5/8] Updated changelog with new features Closes CURA-9525 --- resources/texts/change_log.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/texts/change_log.txt b/resources/texts/change_log.txt index 8030327dd2..2718c4bdf0 100644 --- a/resources/texts/change_log.txt +++ b/resources/texts/change_log.txt @@ -1,3 +1,9 @@ +[5.1.1] +* New features: +- Added support for the Ultimaker S3 and Ultimaker S5 updated mainbord + +MacOS 10.15 is no longer supported. Technically this means Ultimaker will stop testing and developing for such operating systems. However, even though it is no longer supported, there is still a high likelihood the application keeps functioning. + [5.1] For an overview of the new features in Cura 5.1, please watch our video. @@ -370,4 +376,4 @@ When searching in the settings visibility menu you will also search in the descr [4.10] -The release notes of versions <= 4.10 can be found in our releases GitHub page. \ No newline at end of file +The release notes of versions <= 4.10 can be found in our releases GitHub page. From 770307d53ae6cde58f943a111b7a8c03ae4255bb Mon Sep 17 00:00:00 2001 From: jelle Spijker Date: Wed, 7 Sep 2022 07:49:21 +0200 Subject: [PATCH 6/8] Allow specifying version with conan conf By setting the `user.cura:version` in the configuration of Conan that version string is used preferred over the actual version This should be usefully for releases Contributes to CURA-8831 --- conanfile.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/conanfile.py b/conanfile.py index c5f584ed16..17cd0260a6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -149,9 +149,9 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("CuraVersion.py.jinja"), "r") as f: cura_version_py = Template(f.read()) - cura_version = self.version + cura_version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) if self.options.internal: - version = Version(self.version) + version = Version(cura_version) cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.prerelease.replace('+', '+internal_')}" with open(Path(location, "CuraVersion.py"), "w") as f: @@ -220,7 +220,8 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("Ultimaker-Cura.spec.jinja"), "r") as f: pyinstaller = Template(f.read()) - cura_version = Version(self.version) if self.version else Version("0.0.0") + version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + cura_version = Version(version) with open(Path(location, "Ultimaker-Cura.spec"), "w") as f: f.write(pyinstaller.render( @@ -239,7 +240,7 @@ class CuraConan(ConanFile): strip = False, # This should be possible on Linux and MacOS but, it can also cause issues on some distributions. Safest is to disable it for now target_arch = "'x86_64'" if self.settings.os == "Macos" else "None", # FIXME: Make this dependent on the settings.arch_target macos = self.settings.os == "Macos", - version = f"'{self.version}'", + version = f"'{version}'", short_version = f"'{cura_version.major}.{cura_version.minor}.{cura_version.patch}'", )) @@ -254,7 +255,8 @@ class CuraConan(ConanFile): self.options["cpython"].shared = True def validate(self): - if self.version and Version(self.version) <= Version("4"): + version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + if version and Version(version) <= Version("4"): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): @@ -381,7 +383,8 @@ class CuraConan(ConanFile): self.copy("*.txt", src = self.cpp_info.resdirs[-1], dst = self._base_dir.joinpath("pip_requirements")) # Generate the GitHub Action version info Environment - cura_version = Version(self.version) + version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + cura_version = Version(version) env_prefix = "Env:" if self.settings.os == "Windows" else "" activate_github_actions_version_env = Template(r"""echo "CURA_VERSION_MAJOR={{ cura_version_major }}" >> ${{ env_prefix }}GITHUB_ENV echo "CURA_VERSION_MINOR={{ cura_version_minor }}" >> ${{ env_prefix }}GITHUB_ENV From b69eb0180e038edcbc945b1c611c6d0dafe75e96 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 10:34:04 +0200 Subject: [PATCH 7/8] Use conf to obtain configuration Contributes to CURA-8831 --- conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 17cd0260a6..981e285bef 100644 --- a/conanfile.py +++ b/conanfile.py @@ -149,7 +149,7 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("CuraVersion.py.jinja"), "r") as f: cura_version_py = Template(f.read()) - cura_version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + cura_version = self.conf.get("user.cura:version", default = self.version, check_type = str) if self.options.internal: version = Version(cura_version) cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.prerelease.replace('+', '+internal_')}" @@ -220,7 +220,7 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("Ultimaker-Cura.spec.jinja"), "r") as f: pyinstaller = Template(f.read()) - version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + version = self.conf.get("user.cura:version", default = self.version, check_type = str) cura_version = Version(version) with open(Path(location, "Ultimaker-Cura.spec"), "w") as f: @@ -255,7 +255,7 @@ class CuraConan(ConanFile): self.options["cpython"].shared = True def validate(self): - version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + version = self.conf.get("user.cura:version", default = self.version, check_type = str) if version and Version(version) <= Version("4"): raise ConanInvalidConfiguration("Only versions 5+ are support") @@ -383,7 +383,7 @@ class CuraConan(ConanFile): self.copy("*.txt", src = self.cpp_info.resdirs[-1], dst = self._base_dir.joinpath("pip_requirements")) # Generate the GitHub Action version info Environment - version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) + version = self.conf.get("user.cura:version", default = self.version, check_type = str) cura_version = Version(version) env_prefix = "Env:" if self.settings.os == "Windows" else "" activate_github_actions_version_env = Template(r"""echo "CURA_VERSION_MAJOR={{ cura_version_major }}" >> ${{ env_prefix }}GITHUB_ENV From 6aa68ddb33308fe747d34ce05eee2becd017ab54 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 7 Sep 2022 11:05:39 +0200 Subject: [PATCH 8/8] Improved readability of changelog --- resources/texts/change_log.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/texts/change_log.txt b/resources/texts/change_log.txt index 2718c4bdf0..74d02d40b6 100644 --- a/resources/texts/change_log.txt +++ b/resources/texts/change_log.txt @@ -2,6 +2,7 @@ * New features: - Added support for the Ultimaker S3 and Ultimaker S5 updated mainbord + MacOS 10.15 is no longer supported. Technically this means Ultimaker will stop testing and developing for such operating systems. However, even though it is no longer supported, there is still a high likelihood the application keeps functioning. [5.1]