diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 8953cba..64528da 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -8,41 +8,68 @@ on: - 'CMakelists.txt' - '.github/workflows/conan-package.yml' - '.github/workflows/requirements*.txt' + branches: + - main + - 'CURA-*' + - 'PP-*' + - 'NP-*' + - '[0-9].[0-9]*' + - '[0-9].[0-9][0-9]*' jobs: +# FIXME: Use main once merged conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-11622_conan_v2 with: project_name: curaengine_grpc_definitions +# FIXME: Use main once merged conan-package-export: needs: [ conan-recipe-version ] - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} secrets: inherit +# FIXME: Use main once merged conan-package-create-macos: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} secrets: inherit +# FIXME: Use main once merged conan-package-create-windows: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} secrets: inherit +# FIXME: Use main once merged conan-package-create-linux: needs: [ conan-recipe-version, conan-package-export ] if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-11622_conan_v2 with: + recipe_id_name: ${{ needs.conan-recipe-version.outputs.project_name }} + recipe_id_version: ${{ needs.conan-recipe-version.outputs.recipe_semver_full }} + recipe_id_user: ${{ needs.conan-recipe-version.outputs.user }} + recipe_id_channel: ${{ needs.conan-recipe-version.outputs.channel }} recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - secrets: inherit + secrets: inherit \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 3edb87b..55aa190 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,5 +1,6 @@ -# Copyright (c) 2023 UltiMaker +# Copyright (c) 2024 UltiMaker # curaengine_grpc_definitions is released under the terms of the MIT + import os from pathlib import Path @@ -10,9 +11,9 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import copy, update_conandata from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc -from conan.tools.scm import Version +from conan.tools.scm import Version, Git -required_conan_version = ">=1.58.0 <2.0.0" +required_conan_version = ">=1.58.0" class CuraEngine_gRPC_DefinitionsConan(ConanFile): @@ -39,6 +40,10 @@ def set_version(self): if not self.version: self.version = self.conan_data["version"] + def export(self): + git = Git(self) + update_conandata(self, {"version": self.version, "commit": git.get_commit()}) + @property def _min_cppstd(self): return 20 @@ -53,9 +58,6 @@ def _compilers_minimum_version(self): "visual_studio": "17", } - def export(self): - update_conandata(self, {"version": self.version}) - def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) copy(self, "*.proto", self.recipe_folder, self.export_sources_folder) @@ -96,10 +98,10 @@ def layout(self): def requirements(self): self.requires("protobuf/3.21.12", transitive_headers = True) - self.requires("boost/1.82.0") - self.requires("asio-grpc/2.6.0") - self.requires("grpc/1.50.1", transitive_headers = True) - self.requires("openssl/3.2.0") + self.requires("boost/1.83.0") + self.requires("asio-grpc/2.9.2") + self.requires("grpc/1.54.3", transitive_headers = True) + self.requires("openssl/3.2.1") def validate(self): # validate the minimum cpp standard supported. For C++ projects only @@ -119,7 +121,6 @@ def build_requirements(self): self.tool_requires("protobuf/3.21.9") def generate(self): - # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist tc = CMakeToolchain(self) if is_msvc(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self)