Skip to content

Commit

Permalink
Merge pull request #14 from Ultimaker/CURA-10831
Browse files Browse the repository at this point in the history
CURA-10831
  • Loading branch information
jellespijker authored Dec 8, 2023
2 parents 7e6d14c + 6eb33df commit c163ce9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 57 deletions.
60 changes: 9 additions & 51 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
---
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:
push:
paths:
- '**/*.proto'
Expand All @@ -18,73 +11,38 @@ on:

jobs:
conan-recipe-version:
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
with:
project_name: curaengine_grpc_definitions

conan-package-export:
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
uses: ultimaker/cura-workflows/.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 }}
runs_on: 'ubuntu-22.04'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

conan-package-create-macos:
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
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
with:
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 3
runs_on: 'macos-11'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

conan-package-create-windows:
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
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
with:
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 4
runs_on: 'windows-2022'
python_version: '3.11.x'
conan_config_branch: ''
conan_logging_level: 'info'
secrets: inherit

conan-package-create-linux-modern:
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
conan-package-create-linux:
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
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
with:
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
build_id: 2
runs_on: 'ubuntu-22.04'
python_version: '3.11.x'
conan_logging_level: 'info'
secrets: inherit

notify-export:
if: ${{ always() && (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
needs: [ conan-recipe-version, conan-package-create-macos, conan-package-create-windows, conan-package-create-linux-modern ]

uses: ultimaker/cura/.github/workflows/notify.yml@main
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
1 change: 0 additions & 1 deletion .github/workflows/requirements-conan-package.txt

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "curaengine_grpc_definitions"
version = "0.2.0-alpha"
version = "0.2.0-alpha.0"
authors = ["Casper <[email protected]>"]
description = "CuraEngine gRPC definitions"
repository = "https://github.com/Ultimaker/curaengine_grpc_definitions"
Expand Down
1 change: 1 addition & 0 deletions conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: 0.2.0-alpha.0
13 changes: 10 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import copy
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

required_conan_version = ">=1.56.0"
required_conan_version = ">=1.58.0 <2.0.0"


class CuraEngine_gRPC_DefinitionsConan(ConanFile):
Expand All @@ -35,6 +35,10 @@ class CuraEngine_gRPC_DefinitionsConan(ConanFile):
"fPIC": True,
}

def set_version(self):
if not self.version:
self.version = self.conan_data["version"]

@property
def _min_cppstd(self):
return 20
Expand All @@ -49,6 +53,9 @@ 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)
Expand Down Expand Up @@ -92,7 +99,7 @@ def requirements(self):
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/1.1.1l")
self.requires("openssl/3.2.0")

def validate(self):
# validate the minimum cpp standard supported. For C++ projects only
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def generate_proto_sources(self):

setup(
name = "CuraEngineGRPC",
version = "0.2.0-alpha",
version = "0.2.0-alpha.0",
description = "A gRPC package using proto files with type hints",
author = "UltiMaker",
author_email = "[email protected]",
Expand Down

0 comments on commit c163ce9

Please sign in to comment.