From 2dfe6d7e5df4251bd2deac449453bc3d09248ac5 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:54:23 +0100 Subject: [PATCH 01/41] Set requirements and version with conandata This will allow workflow automations to easily create release branches and set the versions Contributes to CURA-10831 --- conandata.yml | 19 +++++++++++++++++++ conanfile.py | 26 +++++++------------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/conandata.yml b/conandata.yml index c027bde567..a36e30983c 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,3 +1,22 @@ +version: "5.6.0-beta.1" +requirements: + - "uranium/(latest)@ultimaker/stable" + - "curaengine/(latest)@ultimaker/stable" + - "cura_binary_data/(latest)@ultimaker/stable" + - "fdm_materials/(latest)@ultimaker/stable" + - "curaengine_plugin_gradual_flow/0.1.0" + - "dulcificum/(latest)@ultimaker/stable" + - "pyarcus/5.3.0" + - "pysavitar/5.3.0" + - "pynest2d/5.3.0" + - "curaengine_grpc_definitions/0.1.0" + - "cpython/3.10.4" + - "boost/1.82.0" + - "fmt/9.0.0" + - "zlib/1.2.13" +requirements_internal: + - "fdm_materials/(latest)@internal/testing" + - "cura_private_data/(latest)@internal/testing" urls: default: cloud_api_root: "https://api.ultimaker.com" diff --git a/conanfile.py b/conanfile.py index 20ded4bc3c..ae0caaacdf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -50,7 +50,7 @@ class CuraConan(ConanFile): def set_version(self): if not self.version: - self.version = "5.6.0-beta.1" + self.version = self.conan_data["version"] @property def _pycharm_targets(self): @@ -313,24 +313,12 @@ class CuraConan(ConanFile): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): - self.requires("boost/1.82.0") - self.requires("fmt/9.0.0") - self.requires("curaengine_grpc_definitions/0.1.0") - self.requires("zlib/1.2.13") - self.requires("pyarcus/5.3.0") - self.requires("dulcificum/(latest)@ultimaker/stable") - self.requires("curaengine/(latest)@ultimaker/stable") - self.requires("pysavitar/5.3.0") - self.requires("pynest2d/5.3.0") - self.requires("curaengine_plugin_gradual_flow/0.1.0") - self.requires("uranium/(latest)@ultimaker/stable") - self.requires("cura_binary_data/(latest)@ultimaker/stable") - self.requires("cpython/3.10.4") - if self.options.internal: - self.requires("cura_private_data/(latest)@internal/testing") - self.requires("fdm_materials/(latest)@internal/testing") - else: - self.requires("fdm_materials/(latest)@ultimaker/stable") + for req in self.conan_data["requirements"]: + if self.options.internal and "fdm_materials" in req: + continue + self.requires(req) + for req in self.conan_data["requirements_internal"]: + self.requires(req) def build_requirements(self): if self.options.get_safe("enable_i18n", False): From 220054cbb52db2d245360f5ba38dcf5c92bf1b85 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:59:53 +0100 Subject: [PATCH 02/41] Use cura-workflows to determine version Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 2 +- .github/workflows/conan-recipe-version.yml | 217 --------------------- .github/workflows/unit-test.yml | 2 +- 3 files changed, 2 insertions(+), 219 deletions(-) delete mode 100644 .github/workflows/conan-recipe-version.yml diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 4b5c0f914a..ad460f56b9 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -63,7 +63,7 @@ jobs: permissions: contents: read - uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: cura diff --git a/.github/workflows/conan-recipe-version.yml b/.github/workflows/conan-recipe-version.yml deleted file mode 100644 index 097b9f5dd6..0000000000 --- a/.github/workflows/conan-recipe-version.yml +++ /dev/null @@ -1,217 +0,0 @@ -name: Get Conan Recipe Version - -on: - workflow_call: - inputs: - project_name: - required: true - type: string - - user: - required: false - default: ultimaker - type: string - - additional_buildmetadata: - required: false - default: "" - type: string - - outputs: - recipe_id_full: - description: "The full Conan recipe id: /@/" - value: ${{ jobs.get-semver.outputs.recipe_id_full }} - - recipe_id_latest: - description: "The full Conan recipe aliased (latest) id: /(latest)@/" - value: ${{ jobs.get-semver.outputs.recipe_id_latest }} - - recipe_semver_full: - 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 }} - - user: - description: "The conan user" - value: ${{ jobs.get-semver.outputs.user }} - - channel: - description: "The conan channel" - value: ${{ jobs.get-semver.outputs.channel }} - - project_name: - description: "The conan projectname" - value: ${{ inputs.project_name }} - -jobs: - get-semver: - - runs-on: ubuntu-latest - - outputs: - 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 }} - - - 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.base_ref }} - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: "3.11.x" - 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 - pip install gitpython - - - id: get-conan-broadcast-data - name: Get Conan broadcast data - run: | - import subprocess - import os - from conan.tools.scm import Version - from conan.errors import ConanException - from git import Repo - - repo = Repo('.') - user = "${{ inputs.user }}".lower() - project_name = "${{ inputs.project_name }}" - event_name = "${{ github.event_name }}" - issue_number = "${{ github.ref }}".split('/')[2] - is_tag = "${{ github.ref_type }}" == "tag" - is_release_branch = False - ref_name = "${{ github.base_ref }}" if event_name == "pull_request" else "${{ github.ref_name }}" - 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 = Version(ref_name) - is_release_branch = True - channel = "_" - user = "_" - actual_version = f"{branch_version}" - else: - try: - branch_version = Version(repo.active_branch.name) - except ConanException: - branch_version = Version('0.0.0') - if ref_name == f"{branch_version.major}.{branch_version.minor}": - channel = 'stable' - is_release_branch = True - elif ref_name in ("main", "master"): - channel = 'testing' - else: - channel = "_".join(repo.active_branch.name.replace("-", "_").split("_")[:2]).lower() - - if "pull_request" in event_name: - channel = f"pr_{issue_number}" - - # %% Get the actual version - latest_branch_version = Version("0.0.0") - latest_branch_tag = None - for tag in repo.active_branch.repo.tags: - if str(tag).startswith("firmware") or str(tag).startswith("master"): - continue # Quick-fix for the versioning scheme name of the embedded team in fdm_materials(_private) repo - try: - version = Version(tag) - except ConanException: - continue - if version > latest_branch_version and version < Version("6.0.0"): - # FIXME: stupid old Cura tags 13.04 etc. keep popping up, als the fdm_material tag for firmware are messing with this - latest_branch_version = version - latest_branch_tag = repo.tag(tag) - - if latest_branch_tag: - # %% Get the actual version - sha_commit = repo.commit().hexsha[:6] - latest_branch_version_prerelease = latest_branch_version.pre - if latest_branch_version.pre and not "." in str(latest_branch_version.pre): - # The prerealese did not contain a version number, default it to 1 - latest_branch_version_prerelease = f"{latest_branch_version.pre}.1" - if event_name == "pull_request": - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{str(latest_branch_version_prerelease).lower()}+{buildmetadata}pr_{issue_number}_{sha_commit}" - channel_metadata = f"{channel}_{sha_commit}" - else: - if channel in ("stable", "_", ""): - channel_metadata = f"{sha_commit}" - else: - channel_metadata = f"{channel}_{sha_commit}" - if is_release_branch: - if (latest_branch_version.pre == "" or latest_branch_version.pre is None) and branch_version > latest_branch_version: - actual_version = f"{branch_version.major}.{branch_version.minor}.0-beta.1+{buildmetadata}{channel_metadata}" - elif latest_branch_version.pre == "": - # An actual full release has been created, we are working on patch - bump_up_patch = int(str(latest_branch_version.patch)) + 1 - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{bump_up_patch}-beta.1+{buildmetadata}{channel_metadata}" - elif latest_branch_version.pre is None: - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{int(latest_branch_version.patch.value) + 1}-beta.1+{buildmetadata}{channel_metadata}" - else: - # An beta release has been created we are working toward a next beta or full release - bump_up_release_tag = int(str(latest_branch_version.pre).split('.')[1]) + 1 - actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{str(latest_branch_version.pre).split('.')[0]}.{bump_up_release_tag}+{buildmetadata}{channel_metadata}" - else: - max_branches_version = Version("0.0.0") - for branch in repo.references: - try: - if "remotes/origin" in branch.abspath: - b_version = Version(branch.name.split("/")[-1]) - if b_version < Version("6.0.0") and b_version > max_branches_version: - max_branches_version = b_version - except: - pass - if max_branches_version > latest_branch_version: - actual_version = f"{max_branches_version.major}.{int(str(max_branches_version.minor)) + 1}.0-alpha+{buildmetadata}{channel}_{sha_commit}" - else: - actual_version = f"{latest_branch_version.major}.{int(str(latest_branch_version.minor)) + 1}.0-alpha+{buildmetadata}{channel_metadata}" - - # %% Set the environment output - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"name={project_name}\n") - f.writelines(f"version={actual_version}\n") - f.writelines(f"channel={channel}\n") - f.writelines(f"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\n") - f.writelines(f"recipe_id_latest={project_name}/latest@{user}/{channel}\n") - f.writelines(f"semver_full={actual_version}\n") - f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n") - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - with open(summary_env, "w") as f: - f.writelines(f"# {project_name}\n") - f.writelines(f"name={project_name}\n") - f.writelines(f"version={actual_version}\n") - f.writelines(f"channel={channel}\n") - f.writelines(f"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\n") - f.writelines(f"recipe_id_latest={project_name}/latest@{user}/{channel}\n") - f.writelines(f"semver_full={actual_version}\n") - f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n") - shell: python diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 8321f42a23..2f8f593199 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -64,7 +64,7 @@ permissions: jobs: conan-recipe-version: - uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: cura From 33ecec6951c7cbb7449c4cd3d27a72e45cf618ba Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 10:42:05 +0100 Subject: [PATCH 03/41] add release tagging info to conandata Contributes to CURA-10831 --- conandata.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/conandata.yml b/conandata.yml index a36e30983c..16d79c4ffa 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,4 +1,5 @@ version: "5.6.0-beta.1" +release: false requirements: - "uranium/(latest)@ultimaker/stable" - "curaengine/(latest)@ultimaker/stable" From 1fb1fe9faa93a3f65a634f894f7f981bcc9b6cbf Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 11:59:56 +0100 Subject: [PATCH 04/41] don't set release from conandata.yml Contributes to CURA-10831 --- conandata.yml | 5 ----- conanfile.py | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conandata.yml b/conandata.yml index 16d79c4ffa..470f6f32e4 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,5 +1,4 @@ version: "5.6.0-beta.1" -release: false requirements: - "uranium/(latest)@ultimaker/stable" - "curaengine/(latest)@ultimaker/stable" @@ -11,10 +10,6 @@ requirements: - "pysavitar/5.3.0" - "pynest2d/5.3.0" - "curaengine_grpc_definitions/0.1.0" - - "cpython/3.10.4" - - "boost/1.82.0" - - "fmt/9.0.0" - - "zlib/1.2.13" requirements_internal: - "fdm_materials/(latest)@internal/testing" - "cura_private_data/(latest)@internal/testing" diff --git a/conanfile.py b/conanfile.py index ae0caaacdf..9f22d10f23 100644 --- a/conanfile.py +++ b/conanfile.py @@ -319,6 +319,10 @@ class CuraConan(ConanFile): self.requires(req) for req in self.conan_data["requirements_internal"]: self.requires(req) + self.requires("cpython/3.10.4") + self.requires("boost/1.82.0") + self.requires("fmt/9.0.0") + self.requires("zlib/1.2.13") def build_requirements(self): if self.options.get_safe("enable_i18n", False): From 1216674728924877783b3a920fc2c80e7c353d85 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 12 Nov 2023 11:00:21 +0100 Subject: [PATCH 05/41] Modernize conanfile.py This commit updates the Uranium dependency in the Conan file and introduces an internationalization (i18n) option. It refactor the devtool checks to check for the "enable_i18n" option instead. Lastly, cleanups and adjustments are done in preparation for enabling i18n in the build process. Contributes to CURA-10831 --- conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conanfile.py b/conanfile.py index 9f22d10f23..d80de96ea3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -318,6 +318,8 @@ class CuraConan(ConanFile): continue self.requires(req) for req in self.conan_data["requirements_internal"]: + if not self.options.internal and "fdm_materials" in req: + continue self.requires(req) self.requires("cpython/3.10.4") self.requires("boost/1.82.0") @@ -495,6 +497,7 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV del self.info.options.cloud_api_version del self.info.options.display_name del self.info.options.cura_debug_mode + self.options.rm_safe("i18n") # TODO: Use the hash of requirements.txt and requirements-ultimaker.txt, Because changing these will actually result in a different # Cura. This is needed because the requirements.txt aren't managed by Conan and therefor not resolved in the package_id. This isn't From 39e505371ef6d1a6674773797b3b6b1c807c975d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 12 Nov 2023 11:08:09 +0100 Subject: [PATCH 06/41] fix option naming should be `enable_i18n` Contributes to CURA-10831 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index d80de96ea3..872bbe6c47 100644 --- a/conanfile.py +++ b/conanfile.py @@ -497,7 +497,7 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV del self.info.options.cloud_api_version del self.info.options.display_name del self.info.options.cura_debug_mode - self.options.rm_safe("i18n") + self.options.rm_safe("enable_i18n") # TODO: Use the hash of requirements.txt and requirements-ultimaker.txt, Because changing these will actually result in a different # Cura. This is needed because the requirements.txt aren't managed by Conan and therefor not resolved in the package_id. This isn't From 96f6aac79bce225f6361739c9329dc943680c21c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 16 Nov 2023 11:46:51 +0100 Subject: [PATCH 07/41] Create the Cura binaries Contributes to CURA-10831 --- .github/workflows/conan-package-create.yml | 153 --------------------- .github/workflows/conan-package.yml | 96 ++----------- 2 files changed, 14 insertions(+), 235 deletions(-) delete mode 100644 .github/workflows/conan-package-create.yml diff --git a/.github/workflows/conan-package-create.yml b/.github/workflows/conan-package-create.yml deleted file mode 100644 index 18e2600e1d..0000000000 --- a/.github/workflows/conan-package-create.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: Create and Upload Conan package - -on: - workflow_call: - inputs: - project_name: - required: true - type: string - - recipe_id_full: - required: true - type: string - - build_id: - required: true - type: number - - build_info: - required: false - default: true - type: boolean - - recipe_id_latest: - 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_clean_local_cache: - required: false - type: boolean - default: false - - conan_upload_community: - required: false - default: true - type: boolean - -env: - CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD: ${{ 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 for runner - run: pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt - # Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo - - - 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" - - - 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-${{ inputs.runs_on }}-${{ runner.arch }}-create-cache - - - name: Cache Conan local repository packages (Powershell) - uses: actions/cache@v3 - if: ${{ runner.os == 'Windows' }} - with: - path: | - C:\Users\runneradmin\.conan\data - C:\.conan - C:\Users\runneradmin\.conan\conan_download_cache - key: conan-${{ inputs.runs_on }}-${{ runner.arch }}-create-cache - - - name: Install MacOS system requirements - if: ${{ runner.os == 'Macos' }} - run: brew install autoconf automake ninja - - # NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest. - # This is maybe because grub caches the disk it uses last time, which is recreated each time. - - name: Install Linux system requirements - if: ${{ runner.os == 'Linux' }} - run: | - sudo rm /var/cache/debconf/config.dat - sudo dpkg --configure -a - 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 flex bison -y - - - name: Install GCC-13 on ubuntu - if: ${{ startsWith(inputs.runs_on, 'ubuntu') }} - run: | - sudo apt install g++-13 gcc-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - - - name: Create the default Conan profile - run: conan profile new default --detect - - - 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 - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Add Cura private Artifactory remote - run: conan remote add cura-private https://ultimaker.jfrog.io/artifactory/api/conan/cura-private True - - - name: Create the Packages - run: conan install ${{ inputs.recipe_id_full }} --build=missing --update -c tools.build:skip_test=True - - - name: Upload the Package(s) - if: ${{ always() && inputs.conan_upload_community }} - run: conan upload ${{ inputs.recipe_id_full }} -r cura --all -c - - - name: Upload the Package(s) to the private Artifactory - if: ${{ always() && ! inputs.conan_upload_community }} - run: conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index ad460f56b9..46831194b1 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -51,95 +51,27 @@ on: 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 -permissions: { } +# FIXME: point to `main` once merged jobs: conan-recipe-version: - permissions: - contents: read - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: cura - conan-package-create-linux: + conan-package-export: needs: [ conan-recipe-version ] - runs-on: 'ubuntu-latest' - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache Conan data - id: cache-conan - uses: actions/cache@v3 - with: - path: ~/.conan - key: ${{ runner.os }}-conan - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.11.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - # NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest. - # This is maybe because grub caches the disk it uses last time, which is recreated each time. - - name: Install Linux system requirements - if: ${{ runner.os == 'Linux' }} - run: | - sudo rm /var/cache/debconf/config.dat - sudo dpkg --configure -a - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt update - sudo apt upgrade - sudo apt install efibootmgr 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 flex bison g++-12 gcc-12 -y - - - name: Install GCC-13 - run: | - sudo apt install g++-13 gcc-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Create the Packages - run: conan create . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o ${{ needs.conan-recipe-version.outputs.project_name }}:devtools=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True -c tools.build:skip_test=True - - - name: Create the latest alias - if: always() - run: conan alias ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - - - name: Upload the Package(s) - if: always() - run: | - conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -r cura --all -c - conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura -c - - 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')) }} - needs: [ conan-recipe-version, conan-package-create-linux ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831 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 }}" + recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} + recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} + secrets: inherit + + conan-package-create-linux: + needs: [ conan-recipe-version, conan-package-export ] + + uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-10831 + with: + recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} + conan_extra_args: '-c tools.build:skip_test=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True' secrets: inherit From 78cafeca4bbcda7a2df8e5628e520f5e1c4f405e Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 16 Nov 2023 13:30:26 +0100 Subject: [PATCH 08/41] Only check internal requirements when building internal Contributes to CURA-10831 --- conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 872bbe6c47..17b42abc37 100644 --- a/conanfile.py +++ b/conanfile.py @@ -317,10 +317,11 @@ class CuraConan(ConanFile): if self.options.internal and "fdm_materials" in req: continue self.requires(req) - for req in self.conan_data["requirements_internal"]: - if not self.options.internal and "fdm_materials" in req: - continue - self.requires(req) + if self.options.internal: + for req in self.conan_data["requirements_internal"]: + if "fdm_materials" in req: + continue + self.requires(req) self.requires("cpython/3.10.4") self.requires("boost/1.82.0") self.requires("fmt/9.0.0") From 01998d2113fbac387b0163f71139cff0c416083c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 16 Nov 2023 13:35:13 +0100 Subject: [PATCH 09/41] Simplify conan-package.yml workflow Removed redundant workflow dispatch inputs and comments in .github/workflows/conan-package.yml. These were unnecessary for the push-based workflow and have been simplified to streamline the process and make it more efficient. Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 46831194b1..e06b7dd2d5 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -1,27 +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: - 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/**' From 9693ec2e0e47f68e64f9ffa805d09bfe792bbc2a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 27 Nov 2023 08:10:34 +0100 Subject: [PATCH 10/41] Merge main and update versions Contribute to CURA-10831 --- conandata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conandata.yml b/conandata.yml index 470f6f32e4..f12f129ec0 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,11 +1,11 @@ -version: "5.6.0-beta.1" +version: "5.7.0-alpha.0" requirements: - "uranium/(latest)@ultimaker/stable" - "curaengine/(latest)@ultimaker/stable" - "cura_binary_data/(latest)@ultimaker/stable" - "fdm_materials/(latest)@ultimaker/stable" - "curaengine_plugin_gradual_flow/0.1.0" - - "dulcificum/(latest)@ultimaker/stable" + - "dulcificum/0.1.0-beta.1" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" From e1110dd412c88d3d841a003bfe2fe9ce9ef5cf49 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 27 Nov 2023 16:23:13 +0100 Subject: [PATCH 11/41] Update workflow to be on par with other repo's Contribute to CURA-10831 --- .github/workflows/conan-package.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index e06b7dd2d5..24793fa4cc 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -11,21 +11,21 @@ on: - 'packaging/**' - '.github/workflows/conan-*.yml' - '.github/workflows/notify.yml' - - '.github/workflows/requirements-conan-package.txt' + - '.github/workflows/requirements-runner.txt' - 'requirements*.txt' - 'conanfile.py' - 'conandata.yml' - - 'GitVersion.yml' - '*.jinja' branches: - - main + - 'main' - 'CURA-*' - - '[1-9].[0-9]' - - '[1-9].[0-9][0-9]' + - 'PP-*' + - '[0-9].[0-9]' + - '[0-9].[0-9][0-9]' tags: - - '[1-9].[0-9].[0-9]*' - - '[1-9].[0-9].[0-9]' - - '[1-9].[0-9][0-9].[0-9]*' + - '[0-9].[0-9].[0-9]*' + - '[0-9].[0-9].[0-9]' + - '[0-9].[0-9][0-9].[0-9]*' env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} From 7ed7cc260e25578c5746b44e2652ca7a16bff890 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 29 Nov 2023 15:22:30 +0100 Subject: [PATCH 12/41] Use testing conan packages Contributes to CURA-10831 --- conandata.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conandata.yml b/conandata.yml index f12f129ec0..9a26235e2c 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,9 +1,9 @@ version: "5.7.0-alpha.0" requirements: - - "uranium/(latest)@ultimaker/stable" - - "curaengine/(latest)@ultimaker/stable" - - "cura_binary_data/(latest)@ultimaker/stable" - - "fdm_materials/(latest)@ultimaker/stable" + - "uranium/(latest)@ultimaker/testing" + - "curaengine/(latest)@ultimaker/testing" + - "cura_binary_data/(latest)@ultimaker/testing" + - "fdm_materials/(latest)@ultimaker/testing" - "curaengine_plugin_gradual_flow/0.1.0" - "dulcificum/0.1.0-beta.1" - "pyarcus/5.3.0" From 0d3a926259c6919e77dc7f39c9ff08f3fbb58ab9 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 29 Nov 2023 16:22:03 +0100 Subject: [PATCH 13/41] Update linux.yml --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1dee7a237f..d8cd580190 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -111,7 +111,7 @@ jobs: 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 binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync -y + 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 binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync libxcb-cursor-dev -y # Get the AppImage tool wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool From b847cf626bed6827aeaa3064bed8fb26a1f59549 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Fri, 1 Dec 2023 11:29:02 +0100 Subject: [PATCH 14/41] Use working CURA-10831 packages Contribute to CURA-10831 --- conandata.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conandata.yml b/conandata.yml index 9a26235e2c..aa83523ad9 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,9 +1,9 @@ version: "5.7.0-alpha.0" requirements: - - "uranium/(latest)@ultimaker/testing" - - "curaengine/(latest)@ultimaker/testing" - - "cura_binary_data/(latest)@ultimaker/testing" - - "fdm_materials/(latest)@ultimaker/testing" + - "uranium/(latest)@ultimaker/cura_10831" + - "curaengine/(latest)@ultimaker/cura_10831" + - "cura_binary_data/(latest)@ultimaker/cura_10831" + - "fdm_materials/(latest)@ultimaker/cura_10831" - "curaengine_plugin_gradual_flow/0.1.0" - "dulcificum/0.1.0-beta.1" - "pyarcus/5.3.0" @@ -11,8 +11,8 @@ requirements: - "pynest2d/5.3.0" - "curaengine_grpc_definitions/0.1.0" requirements_internal: - - "fdm_materials/(latest)@internal/testing" - - "cura_private_data/(latest)@internal/testing" + - "fdm_materials/(latest)@internal/cura_10831" + - "cura_private_data/(latest)@internal/cura_10831" urls: default: cloud_api_root: "https://api.ultimaker.com" From 4d97e779ed3322bc99c53ab7d0f4b7ad152e5d58 Mon Sep 17 00:00:00 2001 From: jellespijker Date: Fri, 1 Dec 2023 16:18:44 +0100 Subject: [PATCH 15/41] Use process-pull-request workflow Contribute to CURA-10831 --- .github/workflows/process-pull-request.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/process-pull-request.yml b/.github/workflows/process-pull-request.yml index 7fe3aedc96..f34e26f13e 100644 --- a/.github/workflows/process-pull-request.yml +++ b/.github/workflows/process-pull-request.yml @@ -1,15 +1,11 @@ name: process-pull-request on: - pull_request_target: - types: [opened, reopened, edited, synchronize, review_requested, ready_for_review, assigned] + pull_request_target: + types: [ opened, reopened, edited, review_requested, ready_for_review, assigned ] +# FIXME: Use `main` instead of `CURA-10831` once merged jobs: - add_label: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-ecosystem/action-add-labels@v1 - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - with: - labels: 'PR: Community Contribution :crown:' \ No newline at end of file + add_label: + uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@CURA-10831 + secrets: inherit \ No newline at end of file From b19d5d47d35a8874c8f2aee14f2a2e311c02d742 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 10:22:44 +0100 Subject: [PATCH 16/41] Use dulcificum 0.1.1-beta.0 Contributes to CURA-10831 --- .github/workflows/notify.yml | 54 ------------------------------------ conandata.yml | 2 +- 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml deleted file mode 100644 index 370b54c78b..0000000000 --- a/.github/workflows/notify.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Get Conan Recipe Version - -on: - workflow_call: - inputs: - success: - required: true - type: boolean - - success_title: - required: true - type: string - - success_body: - required: true - type: string - - failure_title: - required: true - type: string - - failure_body: - required: true - type: string - - -jobs: - slackNotification: - name: Slack Notification - - runs-on: ubuntu-latest - - steps: - - name: Slack notify on-success - if: ${{ inputs.success }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_USERNAME: ${{ github.repository }} - SLACK_COLOR: green - SLACK_ICON: https://github.com/Ultimaker/Cura/blob/main/icons/cura-128.png?raw=true - SLACK_TITLE: ${{ inputs.success_title }} - SLACK_MESSAGE: ${{ inputs.success_body }} - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - - name: Slack notify on-failure - if: ${{ !inputs.success }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_USERNAME: ${{ github.repository }} - SLACK_COLOR: red - SLACK_ICON: https://github.com/Ultimaker/Cura/blob/main/icons/cura-128.png?raw=true - SLACK_TITLE: ${{ inputs.failure_title }} - SLACK_MESSAGE: ${{ inputs.failure_body }} - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/conandata.yml b/conandata.yml index aa83523ad9..d0856481f1 100644 --- a/conandata.yml +++ b/conandata.yml @@ -5,7 +5,7 @@ requirements: - "cura_binary_data/(latest)@ultimaker/cura_10831" - "fdm_materials/(latest)@ultimaker/cura_10831" - "curaengine_plugin_gradual_flow/0.1.0" - - "dulcificum/0.1.0-beta.1" + - "dulcificum/latest@ultimaker/cura_10831" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" From 7f1158c36454184fe00be15e5e22df86cb2c2769 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 13:43:30 +0100 Subject: [PATCH 17/41] Use cura-workflow OS installers Contribute to CURA-10831 --- .github/workflows/installers.yml | 92 ++++++----- .github/workflows/linux.yml | 257 ----------------------------- .github/workflows/macos.yml | 270 ------------------------------- .github/workflows/windows.yml | 264 ------------------------------ 4 files changed, 48 insertions(+), 835 deletions(-) delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 38133ad1de..b3ea88969c 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -50,45 +50,46 @@ jobs: release_tag: ${{ steps.default.outputs.release_tag }} steps: - - name: Output default values - id: default - shell: python - run: | - import os - import datetime - - if "${{ github.event_name }}" != "schedule": - cura_conan_version = "${{ github.event.inputs.cura_conan_version }}" - else: - now = datetime.datetime.now() - cura_conan_version = "cura/latest@ultimaker/stable" if now.hour == int(os.environ['LATEST_RELEASE_SCHEDULE_HOUR']) else "cura/latest@ultimaker/testing" - - release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly" - - # Set cura_conan_version environment variable - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"cura_conan_version={cura_conan_version}\n") - f.writelines(f"release_tag={release_tag}\n") - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines(f"# cura_conan_version = {cura_conan_version}\n") - f.writelines(f"# release_tag = {release_tag}\n") + - name: Output default values + id: default + shell: python + run: | + import os + import datetime + + if "${{ github.event_name }}" != "schedule": + cura_conan_version = "${{ github.event.inputs.cura_conan_version }}" + else: + now = datetime.datetime.now() + cura_conan_version = "cura/latest@ultimaker/stable" if now.hour == int(os.environ['LATEST_RELEASE_SCHEDULE_HOUR']) else "cura/latest@ultimaker/testing" + + release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly" + + # Set cura_conan_version environment variable + output_env = os.environ["GITHUB_OUTPUT"] + content = "" + if os.path.exists(output_env): + with open(output_env, "r") as f: + content = f.read() + with open(output_env, "w") as f: + f.write(content) + f.writelines(f"cura_conan_version={cura_conan_version}\n") + f.writelines(f"release_tag={release_tag}\n") + + summary_env = os.environ["GITHUB_STEP_SUMMARY"] + content = "" + if os.path.exists(summary_env): + with open(summary_env, "r") as f: + content = f.read() + + with open(summary_env, "w") as f: + f.write(content) + f.writelines(f"# cura_conan_version = {cura_conan_version}\n") + f.writelines(f"# release_tag = {release_tag}\n") + # FIXME: point to `main` once merged windows-installer: - uses: ./.github/workflows/windows.yml + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-10831 needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -99,8 +100,9 @@ jobs: operating_system: windows-2022 secrets: inherit + # FIXME: point to `main` once merged linux-installer: - uses: ./.github/workflows/linux.yml + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-10831 needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -111,8 +113,9 @@ jobs: operating_system: ubuntu-22.04 secrets: inherit + # FIXME: point to `main` once merged macos-installer: - uses: ./.github/workflows/macos.yml + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -123,8 +126,9 @@ jobs: operating_system: self-hosted-X64 secrets: inherit + # FIXME: point to `main` once merged macos-arm-installer: - uses: ./.github/workflows/macos.yml + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -142,9 +146,9 @@ jobs: needs: [ default_values, windows-installer, linux-installer, macos-installer, macos-arm-installer ] steps: - name: Checkout - uses: actions/checkout@v3 - - # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped. + uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Download the run info uses: actions/download-artifact@v2 @@ -193,7 +197,7 @@ jobs: with: name: ${{ steps.filename.outputs.LINUX }}-AppImage path: installers - + - name: Download linux installer jobs asc artifacts uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 8b6d892fa0..0000000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,257 +0,0 @@ -name: Linux Installer -run-name: ${{ inputs.cura_conan_version }} for Linux-${{ inputs.architecture }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: choice - options: - - X64 - operating_system: - description: 'OS' - required: true - default: 'ubuntu-22.04' - type: choice - options: - - ubuntu-22.04 - - workflow_call: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: string - operating_system: - description: 'OS' - required: true - default: 'ubuntu-22.04' - type: string - -env: - CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} - -jobs: - cura-installer-create: - runs-on: ${{ inputs.operating_system }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - - name: Cache Conan local repository packages (Bash) - uses: actions/cache@v3 - with: - path: | - $HOME/.conan/data - $HOME/.conan/conan_download_cache - key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache - - - name: Install Linux system requirements - 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 binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync libxcb-cursor-dev -y - - # Get the AppImage tool - 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 - - # Get the AppImage builder - wget --no-check-certificate --quiet -O $GITHUB_WORKSPACE/appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage - chmod +x appimage-builder-x86_64.AppImage - echo "APPIMAGEBUILDER_LOCATION=$GITHUB_WORKSPACE/appimage-builder-x86_64.AppImage" >> $GITHUB_ENV - - # Make sure these tools can be found on the path - echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - - - name: Install GCC-13 - run: | - sudo apt install g++-13 gcc-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Configure GPG Key Linux (Bash) - run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Use Conan download cache (Bash) - run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" - - - name: Create the Packages (Bash) - run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING -c tools.build:skip_test=True - - - name: Remove internal packages before uploading - run: | - conan remove "*@internal/*" -f || true - conan remove "cura_private_data*" -f || true - - - name: Upload the Package(s) - if: always() - run: | - conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (bash) - run: | - . ./cura_inst/bin/activate_github_actions_env.sh - . ./cura_inst/bin/activate_github_actions_version_env.sh - - - name: Create the Cura dist - run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-${{ inputs.architecture }}" - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") - - - name: Summarize the used dependencies - shell: python - run: | - import os - - from cura.CuraVersion import ConanInstalls, PythonInstalls - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") - f.writelines("## Conan packages:\n") - for dep_name, dep_info in ConanInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']} {dep_info['revision']}`\n") - - f.writelines("## Python modules:\n") - for dep_name, dep_info in PythonInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']}`\n") - - - name: Create the Linux AppImage (Bash) - run: | - python ../cura_inst/packaging/AppImage-builder/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage" - chmod +x "${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage" - working-directory: dist - - - name: Upload the AppImage - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-AppImage - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage - retention-days: 5 - - - name: Upload the asc - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-asc - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.AppImage.asc - retention-days: 5 - - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: linux-run-info - path: | - run_info.sh - retention-days: 5 - - notify-export: - if: ${{ always() }} - needs: [ cura-installer-create ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main - with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "Create the Cura distributions" - success_body: "Installers for ${{ inputs.cura_conan_version }}" - failure_title: "Failed to create the Cura distributions" - failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index c7c34d9d51..0000000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,270 +0,0 @@ -name: Macos Installer -run-name: ${{ inputs.cura_conan_version }} for Macos-${{ inputs.architecture }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'ARM64' - type: choice - options: - - X64 - - ARM64 - operating_system: - description: 'OS' - required: true - default: 'self-hosted-ARM64' - type: choice - options: - - self-hosted-X64 - - self-hosted-ARM64 - - macos-11 - - macos-12 - workflow_call: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'ARM64' - type: string - operating_system: - description: 'OS' - required: true - default: 'self-hosted-ARM64' - type: string - -env: - CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }} - MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }} - MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }} - MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }} - MACOS_CERT_INSTALLER_P12: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} - MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }} - MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }} - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} - -jobs: - cura-installer-create: - runs-on: ${{ inputs.operating_system }} - - outputs: - INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.11.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - - name: Cache Conan local repository packages (Bash) - uses: actions/cache@v3 - with: - path: | - $HOME/.conan/data - $HOME/.conan/conan_download_cache - key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache - - - name: Install MacOS system requirements - run: brew install cmake autoconf automake ninja create-dmg - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Remove Macos keychain (Bash) - run: security delete-keychain signing_temp.keychain || true - - - name: Configure Macos keychain Developer Cert(Bash) - id: macos-keychain-developer-cert - uses: apple-actions/import-codesign-certs@v1 - with: - keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} - p12-file-base64: ${{ secrets.MACOS_CERT_P12 }} - p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - - name: Configure Macos keychain Installer Cert (Bash) - id: macos-keychain-installer-cert - uses: apple-actions/import-codesign-certs@v1 - with: - keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }} - create-keychain: false # keychain is created in previous use of action. - p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }} - p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }} - - - name: Remove private Artifactory - run: conan remote remove cura-private-conan-dev || true - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Use Conan download cache (Bash) - run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" - - - name: Create the Packages (Bash) - run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING -c tools.build:skip_test=True - - - name: Remove internal packages before uploading - run: | - conan remove "*@internal/*" -f || true - conan remove "cura_private_data*" -f || true - - - name: Upload the Package(s) - run: | - conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (bash) - run: | - . ./cura_inst/bin/activate_github_actions_env.sh - . ./cura_inst/bin/activate_github_actions_version_env.sh - - - name: Unlock Macos keychain (Bash) - run: security unlock -p $TEMP_KEYCHAIN_PASSWORD signing_temp.keychain - env: - TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain-developer-cert.outputs.keychain-password }} - - - name: Create the Cura dist - run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-${{ inputs.architecture }}" - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") - - - name: Summarize the used dependencies - shell: python - run: | - import os - - from cura.CuraVersion import ConanInstalls, PythonInstalls - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") - f.writelines("## Conan packages:\n") - for dep_name, dep_info in ConanInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']} {dep_info['revision']}`\n") - - f.writelines("## Python modules:\n") - for dep_name, dep_info in PythonInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']}`\n") - - - name: Create the Macos dmg (Bash) - run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ steps.filename.outputs.INSTALLER_FILENAME }}" --build_dmg --build_pkg --app_name "$CURA_APP_NAME" - working-directory: dist - - - name: Upload the dmg - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-dmg - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.dmg - retention-days: 5 - - - name: Upload the pkg - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-pkg - path: | - dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.pkg - retention-days: 5 - - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: macos-run-info - path: | - run_info.sh - retention-days: 5 - - - notify-export: - if: ${{ always() }} - needs: [ cura-installer-create ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main - with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "Create the Cura distributions" - success_body: "Installers for ${{ inputs.cura_conan_version }}" - failure_title: "Failed to create the Cura distributions" - failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index dfffc4540b..0000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,264 +0,0 @@ -name: Windows Installer -run-name: ${{ inputs.cura_conan_version }} for Windows-${{ inputs.architecture }} by @${{ github.actor }} - -on: - workflow_dispatch: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: choice - options: - - X64 - operating_system: - description: 'OS' - required: true - default: 'windows-2022' - type: choice - options: - - windows-2022 - workflow_call: - inputs: - cura_conan_version: - description: 'Cura Conan Version' - default: 'cura/latest@ultimaker/testing' - required: true - type: string - conan_args: - description: 'Conan args: eq.: --require-override' - default: '' - required: false - type: string - enterprise: - description: 'Build Cura as an Enterprise edition' - default: false - required: true - type: boolean - staging: - description: 'Use staging API' - default: false - required: true - type: boolean - architecture: - description: 'Architecture' - required: true - default: 'X64' - type: string - operating_system: - description: 'OS' - required: true - default: 'windows-2022' - type: string - -env: - CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} - WIN_CERT_INSTALLER_CER: ${{ secrets.WIN_CERT_INSTALLER_CER }} - WIN_CERT_INSTALLER_CER_PASS: ${{ secrets.WIN_CERT_INSTALLER_CER_PASS }} - CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }} - ENTERPRISE: ${{ inputs.enterprise }} - STAGING: ${{ inputs.staging }} - -jobs: - cura-installer-create: - runs-on: ${{ inputs.operating_system }} - - outputs: - INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.10.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - - name: Cache Conan local repository packages (Powershell) - uses: actions/cache@v3 - with: - path: | - C:\Users\runneradmin\.conan\data - C:\.conan - C:\Users\runneradmin\.conan\conan_download_cache - key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache - - - name: Create the default Conan profile - run: conan profile new default --detect --force - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Use Conan download cache (Powershell) - run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache" - - - name: Create the Packages (Powershell) - run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING -c tools.build:skip_test=True - - - name: Remove internal packages before uploading - run: | - conan remove "*@internal/*" -f || true - conan remove "cura_private_data*" -f || true - - - name: Upload the Package(s) - if: always() - run: | - conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (Powershell) - run: | - echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - .\cura_inst\Scripts\activate_github_actions_env.ps1 - .\cura_inst\Scripts\activate_github_actions_version_env.ps1 - - - name: Create the Cura dist - run: pyinstaller ./cura_inst/UltiMaker-Cura.spec - - - name: Output the name file name and extension - id: filename - shell: python - run: | - import os - enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else "" - installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-${{ inputs.architecture }}" - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"INSTALLER_FILENAME={installer_filename}\n") - - - name: Summarize the used dependencies - shell: python - run: | - import os - - from cura.CuraVersion import ConanInstalls, PythonInstalls - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n") - f.writelines("## Conan packages:\n") - for dep_name, dep_info in ConanInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']} {dep_info['revision']}`\n") - - f.writelines("## Python modules:\n") - for dep_name, dep_info in PythonInstalls.items(): - f.writelines(f"`{dep_name} {dep_info['version']}`\n") - - - name: Create PFX certificate from BASE64_PFX_CONTENT secret - id: create-pfx - env: - PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }} - run: | - $pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; - $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); - Set-Content $pfxPath -Value $encodedBytes -AsByteStream; - echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT; - - - name: Create the Windows msi installer (Powershell) - run: | - python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" "$Env:CURA_APP_NAME" - working-directory: dist - - - name: Sign the Windows msi installer (Powershell) - env: - PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} - run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.msi" - working-directory: dist - - - name: Create the Windows exe installer (Powershell) - run: | - python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" - working-directory: dist - - - name: Sign the Windows exe installer (Powershell) - env: - PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} - run: | - & "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{steps.filename.outputs.INSTALLER_FILENAME }}.exe" - working-directory: dist - - - name: Upload the msi - uses: actions/upload-artifact@v3 - with: - name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-msi - path: | - dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.msi - retention-days: 5 - - - name: Upload the exe - uses: actions/upload-artifact@v3 - with: - name: ${{steps.filename.outputs.INSTALLER_FILENAME }}-exe - path: | - dist/${{steps.filename.outputs.INSTALLER_FILENAME }}.exe - retention-days: 5 - - # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - - name: Write the run info - shell: python - run: | - import os - with open("run_info.sh", "w") as f: - f.writelines(f'echo "CURA_VERSION_FULL={os.environ["CURA_VERSION_FULL"]}" >> $GITHUB_ENV\n') - - # NOTE: The extension is .sh, since this isn't going to build-environment, so not on the Win build image. - - name: Upload the run info - uses: actions/upload-artifact@v3 - with: - name: windows-run-info - path: | - run_info.sh - retention-days: 5 - - notify-export: - if: ${{ always() }} - needs: [ cura-installer-create ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main - with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "Create the Cura distributions" - success_body: "Installers for ${{ inputs.cura_conan_version }}" - failure_title: "Failed to create the Cura distributions" - failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit From 2d3ef87a472bf60252f3a214a0ed862badf99f31 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 13:54:08 +0100 Subject: [PATCH 18/41] Use the latest `stable` dulcificum build Contribute to CURA-10831 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index d0856481f1..52f15cb3f3 100644 --- a/conandata.yml +++ b/conandata.yml @@ -5,7 +5,7 @@ requirements: - "cura_binary_data/(latest)@ultimaker/cura_10831" - "fdm_materials/(latest)@ultimaker/cura_10831" - "curaengine_plugin_gradual_flow/0.1.0" - - "dulcificum/latest@ultimaker/cura_10831" + - "dulcificum/latest@ultimaker/stable" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" From 7a4d26452adc81f74f7fc2d6c6700d4c69a1a466 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 14:00:42 +0100 Subject: [PATCH 19/41] Fix testing against literal instead of value Contribute to CURA-10831 --- cura/PrinterOutput/Models/MaterialOutputModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/Models/MaterialOutputModel.py b/cura/PrinterOutput/Models/MaterialOutputModel.py index 6920cead1b..dedcc2136b 100644 --- a/cura/PrinterOutput/Models/MaterialOutputModel.py +++ b/cura/PrinterOutput/Models/MaterialOutputModel.py @@ -43,7 +43,7 @@ class MaterialOutputModel(QObject): } - if guid is None and brand is not "empty" and type in _MATERIAL_MAP: + if guid is None and brand != "empty" and type in _MATERIAL_MAP: name = _MATERIAL_MAP[type]["name"] guid = _MATERIAL_MAP[type]["guid"] return name, guid From 20ab319ec07c501a017b6cf6e6d73350d029f638 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 16:31:50 +0100 Subject: [PATCH 20/41] Use default values from cura-workflows Contributes to CURA-10831 --- .github/workflows/installers.yml | 50 ++++---------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index b3ea88969c..aa1f5a49f0 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -39,53 +39,15 @@ env: CONAN_ARGS: ${{ inputs.conan_args || '' }} ENTERPRISE: ${{ inputs.enterprise || false }} STAGING: ${{ inputs.staging || false }} - LATEST_RELEASE: '5.6' - LATEST_RELEASE_SCHEDULE_HOUR: 4 jobs: default_values: - runs-on: ubuntu-latest - outputs: - cura_conan_version: ${{ steps.default.outputs.cura_conan_version }} - release_tag: ${{ steps.default.outputs.release_tag }} - - steps: - - name: Output default values - id: default - shell: python - run: | - import os - import datetime - - if "${{ github.event_name }}" != "schedule": - cura_conan_version = "${{ github.event.inputs.cura_conan_version }}" - else: - now = datetime.datetime.now() - cura_conan_version = "cura/latest@ultimaker/stable" if now.hour == int(os.environ['LATEST_RELEASE_SCHEDULE_HOUR']) else "cura/latest@ultimaker/testing" - - release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly" - - # Set cura_conan_version environment variable - output_env = os.environ["GITHUB_OUTPUT"] - content = "" - if os.path.exists(output_env): - with open(output_env, "r") as f: - content = f.read() - with open(output_env, "w") as f: - f.write(content) - f.writelines(f"cura_conan_version={cura_conan_version}\n") - f.writelines(f"release_tag={release_tag}\n") - - summary_env = os.environ["GITHUB_STEP_SUMMARY"] - content = "" - if os.path.exists(summary_env): - with open(summary_env, "r") as f: - content = f.read() - - with open(summary_env, "w") as f: - f.write(content) - f.writelines(f"# cura_conan_version = {cura_conan_version}\n") - f.writelines(f"# release_tag = {release_tag}\n") + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-default-value.yml@CURA-10831 + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + latest_release: '5.6' + latest_release_schedule_hour: 4 + latest_release_tag: 'nightly' # FIXME: point to `main` once merged windows-installer: From 040f85c9560951f35994109d62b89c597604bc23 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 17:36:32 +0100 Subject: [PATCH 21/41] Remove redundant export workflow Contributes to CURA-10831 --- .github/workflows/conan-recipe-export.yml | 110 ---------------------- 1 file changed, 110 deletions(-) delete mode 100644 .github/workflows/conan-recipe-export.yml diff --git a/.github/workflows/conan-recipe-export.yml b/.github/workflows/conan-recipe-export.yml deleted file mode 100644 index 69c4e4d34a..0000000000 --- a/.github/workflows/conan-recipe-export.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Export Conan Recipe to server - -on: - workflow_call: - inputs: - recipe_id_full: - required: true - type: string - - recipe_id_latest: - 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 - - conan_upload_community: - required: false - default: true - type: boolean - -env: - CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} - CONAN_PASSWORD: ${{ 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 https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt - conan profile new default --detect - # Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo - - - name: Cache Conan local repository packages - uses: actions/cache@v3 - with: - path: $HOME/.conan/data - key: ${{ runner.os }}-conan-export-cache - - - 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 - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Add Cura private Artifactory remote - run: conan remote add cura-private-conan-dev https://cura.jfrog.io/artifactory/api/conan/cura-private-conan-dev True - - - name: Set GH service account for remote cura-conan-dev - run: conan user -p ${{ secrets.CONAN_GH_RUNNER_PASS }} -r cura-private-conan-dev "${{ secrets.CONAN_GH_RUNNER_USER }}" - - - name: Export the Package (binaries) - if: ${{ inputs.conan_export_binaries }} - run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update -c tools.build:skip_test=True - - - name: Export the Package - if: ${{ !inputs.conan_export_binaries }} - run: conan export . ${{ inputs.recipe_id_full }} - - - name: Create the latest alias - if: always() - run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }} - - - name: Upload the Package(s) - if: ${{ always() && inputs.conan_upload_community }} - run: | - conan upload ${{ inputs.recipe_id_full }} -r cura --all -c - conan upload ${{ inputs.recipe_id_latest }} -r cura -c - - - name: Upload the Package(s) to the private Artifactory - if: ${{ always() && ! inputs.conan_upload_community }} - run: | - conan upload ${{ inputs.recipe_id_full }} -r cura-private-conan-dev --all -c - conan upload ${{ inputs.recipe_id_latest }} -r cura-private-conan-dev -c From 9ad993f8ca0a67ae17f59f2d8ea33eccd4eea9c5 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 18:06:20 +0100 Subject: [PATCH 22/41] Reinstate OS specific installer workflows For those that wants to build a OS specific installer Contributes to CURA-10831 --- .github/workflows/linux.yml | 58 +++++++++++++++++++++ .github/workflows/macos.yml | 62 +++++++++++++++++++++++ .github/workflows/requirements-runner.txt | 0 .github/workflows/windows.yml | 58 +++++++++++++++++++++ 4 files changed, 178 insertions(+) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml create mode 100644 .github/workflows/requirements-runner.txt create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000000..5e63b13c14 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,58 @@ +name: Linux installers +run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} + +on: + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: choice + options: + - X64 + operating_system: + description: 'OS' + required: true + default: 'ubuntu-22.04' + type: choice + options: + - ubuntu-22.04 + +env: + CONAN_ARGS: ${{ inputs.conan_args || '' }} + ENTERPRISE: ${{ inputs.enterprise || false }} + STAGING: ${{ inputs.staging || false }} + +jobs: + # FIXME: point to `main` once merged + windows-installer: + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-10831 + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise == 'true' }} + staging: ${{ inputs.staging == 'true' }} + architecture: ${{ inputs.architecture }} + operating_system: ${{ inputs.operating_system }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000000..42b719f1ca --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,62 @@ +name: MacOS installers +run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} + +on: + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'ARM64' + type: choice + options: + - X64 + - ARM64 + operating_system: + description: 'OS' + required: true + default: 'self-hosted-ARM64' + type: choice + options: + - self-hosted-X64 + - self-hosted-ARM64 + - macos-11 + - macos-12 + +env: + CONAN_ARGS: ${{ inputs.conan_args || '' }} + ENTERPRISE: ${{ inputs.enterprise || false }} + STAGING: ${{ inputs.staging || false }} + +jobs: + # FIXME: point to `main` once merged + windows-installer: + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise == 'true' }} + staging: ${{ inputs.staging == 'true' }} + architecture: ${{ inputs.architecture }} + operating_system: ${{ inputs.operating_system }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/requirements-runner.txt b/.github/workflows/requirements-runner.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..c60aeee51e --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,58 @@ +name: Windows installers +run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} + +on: + workflow_dispatch: + inputs: + cura_conan_version: + description: 'Cura Conan Version' + default: 'cura/latest@ultimaker/testing' + required: true + type: string + conan_args: + description: 'Conan args: eq.: --require-override' + default: '' + required: false + type: string + enterprise: + description: 'Build Cura as an Enterprise edition' + default: false + required: true + type: boolean + staging: + description: 'Use staging API' + default: false + required: true + type: boolean + architecture: + description: 'Architecture' + required: true + default: 'X64' + type: choice + options: + - X64 + operating_system: + description: 'OS' + required: true + default: 'windows-2022' + type: choice + options: + - windows-2022 + +env: + CONAN_ARGS: ${{ inputs.conan_args || '' }} + ENTERPRISE: ${{ inputs.enterprise || false }} + STAGING: ${{ inputs.staging || false }} + +jobs: + # FIXME: point to `main` once merged + windows-installer: + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-10831 + with: + cura_conan_version: ${{ inputs.cura_conan_version }} + conan_args: ${{ inputs.conan_args }} + enterprise: ${{ inputs.enterprise == 'true' }} + staging: ${{ inputs.staging == 'true' }} + architecture: ${{ inputs.architecture }} + operating_system: ${{ inputs.operating_system }} + secrets: inherit \ No newline at end of file From b678951759ff3c804e5b0bbef6450d1c52574ce3 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 18:15:50 +0100 Subject: [PATCH 23/41] Applied work-around for GH true/false instead of True/False Contributes to CURA-10831 --- conanfile.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/conanfile.py b/conanfile.py index de66f1d409..92d0e326d9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -34,7 +34,7 @@ class CuraConan(ConanFile): "cloud_api_version": "ANY", "display_name": "ANY", # TODO: should this be an option?? "cura_debug_mode": [True, False], # FIXME: Use profiles - "internal": [True, False], + "internal": ["True", "False", "true", "false"], # Workaround for GH Action passing boolean as lowercase string "enable_i18n": [True, False], } default_options = { @@ -44,7 +44,7 @@ class CuraConan(ConanFile): "cloud_api_version": "1", "display_name": "UltiMaker Cura", "cura_debug_mode": False, # Not yet implemented - "internal": False, + "internal": "False", "enable_i18n": False, } @@ -84,6 +84,10 @@ class CuraConan(ConanFile): def _enterprise(self): return self.options.enterprise in ["True", 'true'] + @property + def _internal(self): + return self.options.enterprise in ["True", 'true'] + @property def _app_name(self): if self._enterprise: @@ -182,7 +186,7 @@ class CuraConan(ConanFile): cura_version = Version(self.conf.get("user.cura:version", default = self.version, check_type = str)) pre_tag = f"-{cura_version.pre}" if cura_version.pre else "" build_tag = f"+{cura_version.build}" if cura_version.build else "" - internal_tag = f"+internal" if self.options.internal else "" + internal_tag = f"+internal" if self._internal else "" cura_version = f"{cura_version.major}.{cura_version.minor}.{cura_version.patch}{pre_tag}{build_tag}{internal_tag}" with open(os.path.join(location, "CuraVersion.py"), "w") as f: @@ -206,7 +210,7 @@ class CuraConan(ConanFile): pyinstaller_metadata = self.conan_data["pyinstaller"] datas = [] for data in pyinstaller_metadata["datas"].values(): - if not self.options.internal and data.get("internal", False): + if not self._internal and data.get("internal", False): continue if "package" in data: # get the paths from conan package @@ -319,10 +323,10 @@ class CuraConan(ConanFile): def requirements(self): for req in self.conan_data["requirements"]: - if self.options.internal and "fdm_materials" in req: + if self._internal and "fdm_materials" in req: continue self.requires(req) - if self.options.internal: + if self._internal: for req in self.conan_data["requirements_internal"]: if "fdm_materials" in req: continue @@ -392,7 +396,7 @@ class CuraConan(ConanFile): copy(self, "*", fdm_materials.resdirs[0], self.source_folder) # Copy internal resources - if self.options.internal: + if self._internal: cura_private_data = self.dependencies["cura_private_data"].cpp_info copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) From 260a73e14ceea38f4dd15fe4741240a4e25183fd Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 4 Dec 2023 19:51:11 +0100 Subject: [PATCH 24/41] Use older name for OS specific installer workflows Contributes to CURA-10831 --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5e63b13c14..535d087700 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: Linux installers +name: Linux Installer run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} on: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 42b719f1ca..02f45385e7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: MacOS installers +name: MacOS Installer run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} on: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c60aeee51e..ef7e986ec3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: Windows installers +name: Windows Installer run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }} on: From ad96082a1611bae8528ff4bceee41640d5236888 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:03:59 +0100 Subject: [PATCH 25/41] Port unit-test to cura-workflows Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 139 ++++---------------------------- 1 file changed, 16 insertions(+), 123 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 2f8f593199..ca585d54b6 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,4 +1,3 @@ ---- name: unit-test on: @@ -9,23 +8,18 @@ on: - 'cura/**' - 'icons/**' - 'tests/**' - - 'packaging/**' - - '.github/workflows/conan-*.yml' - '.github/workflows/unit-test.yml' - - '.github/workflows/notify.yml' - - '.github/workflows/requirements-conan-package.txt' + - '.github/workflows/requirements-runner.txt' - 'requirements*.txt' - 'conanfile.py' - 'conandata.yml' - - 'GitVersion.yml' - '*.jinja' branches: - main - 'CURA-*' - - '[1-9]+.[0-9]+' - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+-beta' + - 'PP-*' + - '[0-9]+.[0-9]+' + pull_request: paths: - 'plugins/**' @@ -33,35 +27,23 @@ on: - 'cura/**' - 'icons/**' - 'tests/**' - - 'packaging/**' - - '.github/workflows/conan-*.yml' - '.github/workflows/unit-test.yml' - - '.github/workflows/notify.yml' - - '.github/workflows/requirements-conan-package.txt' + - '.github/workflows/requirements-runner.txt' - 'requirements*.txt' - 'conanfile.py' - 'conandata.yml' - - 'GitVersion.yml' - '*.jinja' branches: - main - - '[1-9]+.[0-9]+' - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+-beta' - -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: info - CONAN_NON_INTERACTIVE: 1 + - '[0-9]+.[0-9]+' permissions: contents: read +env: + CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} + CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} + jobs: conan-recipe-version: uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 @@ -69,98 +51,9 @@ jobs: project_name: cura testing: - runs-on: ubuntu-22.04 - needs: [ conan-recipe-version ] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.11.x' - architecture: 'x64' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements and Create default Conan profile - run: pip install -r requirements-conan-package.txt - working-directory: .github/workflows/ - - - name: Use Conan download cache (Bash) - if: ${{ runner.os != 'Windows' }} - run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache" - - - 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 }}-unit-cache - - # NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest. - # This is maybe because grub caches the disk it uses last time, which is recreated each time. - - name: Install Linux system requirements - if: ${{ runner.os == 'Linux' }} - run: | - sudo rm /var/cache/debconf/config.dat - sudo dpkg --configure -a - 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-13 - run: | - sudo apt install g++-13 gcc-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - - - name: Get Conan configuration - run: | - conan config install https://github.com/Ultimaker/conan-config.git - conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" - - - name: Get Conan profile - run: conan profile new default --detect --force - - - name: Install dependencies - run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o cura:devtools=True -g VirtualPythonEnv -if venv - - - name: Upload the Dependency package(s) - run: conan upload "*" -r cura --all -c - - - name: Set Environment variables for Cura (bash) - if: ${{ runner.os != 'Windows' }} - run: | - . ./venv/bin/activate_github_actions_env.sh - - - name: Run Unit Test - id: run-test - run: | - pytest --junitxml=junit_cura.xml - working-directory: tests - - - name: Save PR metadata - if: always() - run: | - echo ${{ github.event.number }} > pr-id.txt - echo ${{ github.event.pull_request.head.repo.full_name }} > pr-head-repo.txt - echo ${{ github.event.pull_request.head.ref }} > pr-head-ref.txt - working-directory: tests - - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v3 - with: - name: test-result - path: | - tests/**/*.xml - tests/pr-id.txt - tests/pr-head-repo.txt - tests/pr-head-ref.txt + uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 + with: + recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} + conan_extra_args: '-o cura:devtools=True -c tools.build:skip_test=False' + unit_test_cmd: 'pytest --junitxml=junit_cura.xml' + unit_test_dir: 'tests' \ No newline at end of file From a69e4f1678c8832831b4adc8fb986c7f0ccf1f1c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:05:12 +0100 Subject: [PATCH 26/41] set needs for testing job Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index ca585d54b6..3083c8f11b 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -52,6 +52,7 @@ jobs: testing: uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 + needs: [ conan-recipe-version ] with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} conan_extra_args: '-o cura:devtools=True -c tools.build:skip_test=False' From 6140d5ad145fb29a39f1ed0f7bb3f5e6468d1256 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:06:40 +0100 Subject: [PATCH 27/41] only run on main/release and PR's Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 3083c8f11b..d7e8543abe 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,8 +16,6 @@ on: - '*.jinja' branches: - main - - 'CURA-*' - - 'PP-*' - '[0-9]+.[0-9]+' pull_request: From a2eb1dc085aa4f92e8487bc2cf9da3e2bfd0f55c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:30:57 +0100 Subject: [PATCH 28/41] Activate all activate_github_action envs Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index d7e8543abe..484490f5ed 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -55,4 +55,5 @@ jobs: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} conan_extra_args: '-o cura:devtools=True -c tools.build:skip_test=False' unit_test_cmd: 'pytest --junitxml=junit_cura.xml' - unit_test_dir: 'tests' \ No newline at end of file + unit_test_dir: 'tests' + conan_generator_dir: './venv/bin' \ No newline at end of file From 3dcf208d73f257b2875bc519ebb8d6dcdd715599 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:31:51 +0100 Subject: [PATCH 29/41] Revert "only run on main/release and PR's" This reverts commit 6140d5ad145fb29a39f1ed0f7bb3f5e6468d1256. --- .github/workflows/unit-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 484490f5ed..2312340a11 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,6 +16,8 @@ on: - '*.jinja' branches: - main + - 'CURA-*' + - 'PP-*' - '[0-9]+.[0-9]+' pull_request: From e688a3a9df0f5b48a1373042bcd82c502e7a8869 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 05:51:48 +0100 Subject: [PATCH 30/41] use relative location of pytest Somehow pytest can't be found on the PATH Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 2312340a11..d8716c9dac 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -56,6 +56,6 @@ jobs: with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} conan_extra_args: '-o cura:devtools=True -c tools.build:skip_test=False' - unit_test_cmd: 'pytest --junitxml=junit_cura.xml' + unit_test_cmd: '../venv/bin/pytest --junitxml=junit_cura.xml' unit_test_dir: 'tests' conan_generator_dir: './venv/bin' \ No newline at end of file From 86493b9c4d19a157907cb4bd08c63f039c184875 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 06:05:21 +0100 Subject: [PATCH 31/41] Use VirtualPythonEnv generator Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index d8716c9dac..714cf9d6af 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -55,7 +55,7 @@ jobs: needs: [ conan-recipe-version ] with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - conan_extra_args: '-o cura:devtools=True -c tools.build:skip_test=False' - unit_test_cmd: '../venv/bin/pytest --junitxml=junit_cura.xml' + conan_extra_args: '-g VirtualPythonEnv -o cura:devtools=True -c tools.build:skip_test=False' + unit_test_cmd: 'pytest --junitxml=junit_cura.xml' unit_test_dir: 'tests' conan_generator_dir: './venv/bin' \ No newline at end of file From f5354c058f90ff7079876dd2693680c727ced7c9 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:08:36 +0100 Subject: [PATCH 32/41] Add FIXME reminders Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 714cf9d6af..6369e7e395 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -45,12 +45,14 @@ env: CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} jobs: + # FIXME: Change to `main` instead of `CURA-10831` once merged conan-recipe-version: uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: cura testing: + # FIXME: Change to `main` instead of `CURA-10831` once merged uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 needs: [ conan-recipe-version ] with: From 1334b65bdfca7bb23e7c95c446f9ad3746fb0e7c Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:17:21 +0100 Subject: [PATCH 33/41] Post the unit test result on PR's Contributes to CURA-10831 --- .github/workflows/unit-test-post.yml | 85 +++------------------------- 1 file changed, 8 insertions(+), 77 deletions(-) diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index 36c1d5acfd..119ca30f33 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -1,82 +1,13 @@ name: unit-test-post on: - workflow_run: - workflows: [ "unit-test" ] - types: [ completed ] + workflow_run: + workflows: [ "unit-test" ] + types: [ completed ] jobs: - publish-test-results: - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - - steps: - - name: Download analysis results - uses: actions/github-script@v3.1.0 - with: - script: | - let artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - let matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "test-result" - })[0]; - let download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: "zip", - }); - let fs = require("fs"); - fs.writeFileSync("${{github.workspace}}/test-result.zip", Buffer.from(download.data)); - - - name: Set environment variables - run: | - mkdir pr_env - unzip test-result.zip -d pr_env - echo "pr_id=$(cat pr_env/pr-id.txt)" >> $GITHUB_ENV - echo "pr_head_repo=$(cat pr_env/pr-head-repo.txt)" >> $GITHUB_ENV - echo "pr_head_ref=$(cat pr_env/pr-head-ref.txt)" >> $GITHUB_ENV - - - uses: actions/checkout@v3 - with: - repository: ${{ env.pr_head_repo }} - ref: ${{ env.pr_head_ref }} - persist-credentials: false - - - name: Redownload analysis results - uses: actions/github-script@v3.1.0 - with: - script: | - let artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - let matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "test-result" - })[0]; - let download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: "zip", - }); - let fs = require("fs"); - fs.writeFileSync("${{github.workspace}}/test-result.zip", Buffer.from(download.data)); - - - name: Extract analysis results - run: | - mkdir -p tests - unzip test-result.zip -d tests - - - name: Publish Unit Test Results - id: test-results - uses: EnricoMi/publish-unit-test-result-action@v1 - with: - files: "tests/**/*.xml" - - - name: Conclusion - run: echo "Conclusion is ${{ steps.test-results.outputs.json && fromJSON( steps.test-results.outputs.json ).conclusion }}" + publish-test-results: + uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 + with: + event: ${{ github.event.workflow_run.event }} + conclusion: ${{ github.event.workflow_run.conclusion }} From b8d41abdeea2d69187ed85eb455f0e384a167d04 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:18:57 +0100 Subject: [PATCH 34/41] Add FIXME reminder Contributes to CURA-10831 --- .github/workflows/unit-test-post.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index 119ca30f33..b4ca2ee699 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -6,6 +6,7 @@ on: types: [ completed ] jobs: + # FIXME: Use `main` instead of `CURA-10831` once merged publish-test-results: uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 with: From 8aa6d2c5b6a2fe645a400fd495394ce475ac7d3f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:44:04 +0100 Subject: [PATCH 35/41] Update conan_data with actual version Contributes to CURA-10831 --- conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 92d0e326d9..f1d73352aa 100644 --- a/conanfile.py +++ b/conanfile.py @@ -4,7 +4,7 @@ from pathlib import Path from jinja2 import Template from conan import ConanFile -from conan.tools.files import copy, rmdir, save, mkdir, rm +from conan.tools.files import copy, rmdir, save, mkdir, rm, update_conandata from conan.tools.microsoft import unix_path from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv from conan.tools.scm import Version @@ -289,6 +289,9 @@ class CuraConan(ConanFile): short_version = f"'{cura_version.major}.{cura_version.minor}.{cura_version.patch}'", )) + def export(self): + update_conandata(self, {"version": self.version}) + def export_sources(self): copy(self, "*", os.path.join(self.recipe_folder, "plugins"), os.path.join(self.export_sources_folder, "plugins")) copy(self, "*", os.path.join(self.recipe_folder, "resources"), os.path.join(self.export_sources_folder, "resources"), excludes = "*.mo") From 704f1280043423489832e9ee5280be8ab750208b Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 10:15:51 +0100 Subject: [PATCH 36/41] Use CURA-10831 working packages for deps Contributes to CURA-10831 --- conandata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conandata.yml b/conandata.yml index 52f15cb3f3..0eec369c96 100644 --- a/conandata.yml +++ b/conandata.yml @@ -4,12 +4,12 @@ requirements: - "curaengine/(latest)@ultimaker/cura_10831" - "cura_binary_data/(latest)@ultimaker/cura_10831" - "fdm_materials/(latest)@ultimaker/cura_10831" - - "curaengine_plugin_gradual_flow/0.1.0" - - "dulcificum/latest@ultimaker/stable" + - "curaengine_plugin_gradual_flow/(latest)@ultimaker/cura_10831" + - "dulcificum/(latest)@ultimaker/cura_10831" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" - - "curaengine_grpc_definitions/0.1.0" + - "curaengine_grpc_definitions/(latest)@ultimaker/cura_10831" requirements_internal: - "fdm_materials/(latest)@internal/cura_10831" - "cura_private_data/(latest)@internal/cura_10831" From f94198c1080fa15023020c7164ec7a3679aa0cbd Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 7 Dec 2023 14:41:44 +0100 Subject: [PATCH 37/41] Fix behaviour of internal property The attribute 'enterprise' in conanfile.py was incorrectly named and has been renamed to 'internal'. This revision ensures that options are accessed correctly to avoid potential issues in usage. Contributes to CURA-10831 --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index f15766a57b..8ade8e771c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -86,7 +86,7 @@ class CuraConan(ConanFile): @property def _internal(self): - return self.options.enterprise in ["True", 'true'] + return self.options.internal in ["True", 'true'] @property def _app_name(self): From 9bb065a294761831977104487ab0f1859888a101 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 07:40:30 +0100 Subject: [PATCH 38/41] make sure fdm_materials is installed for internals Contributes to CURA-10831 --- conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 8ade8e771c..e9d06452f3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -333,8 +333,6 @@ class CuraConan(ConanFile): self.requires(req) if self._internal: for req in self.conan_data["requirements_internal"]: - if "fdm_materials" in req: - continue self.requires(req) self.requires("cpython/3.10.4@ultimaker/stable") self.requires("openssl/3.2.0") From e6812a31d8e7c57a52482dbb47ca8e3ff5217194 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 07:42:06 +0100 Subject: [PATCH 39/41] No need to create a conan-package Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 24793fa4cc..12567fde84 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -45,12 +45,3 @@ jobs: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} secrets: inherit - - conan-package-create-linux: - needs: [ conan-recipe-version, conan-package-export ] - - uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-10831 - with: - recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - conan_extra_args: '-c tools.build:skip_test=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True' - secrets: inherit From f2f2f742bdfa10cd151566423cd9f405284216c1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 14:36:29 +0100 Subject: [PATCH 40/41] Apply suggestions from code review Co-authored-by: Casper Lamboo --- .github/workflows/conan-package.yml | 5 ++--- .github/workflows/installers.yml | 14 +++++--------- .github/workflows/linux.yml | 3 +-- .github/workflows/macos.yml | 3 +-- .github/workflows/process-pull-request.yml | 3 +-- .github/workflows/unit-test-post.yml | 3 +-- .github/workflows/unit-test.yml | 6 ++---- .github/workflows/windows.yml | 3 +-- conandata.yml | 18 +++++++++--------- 9 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 12567fde84..7ca2b0c467 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -31,16 +31,15 @@ env: CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }} CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }} -# FIXME: point to `main` once merged jobs: conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main with: project_name: cura conan-package-export: needs: [ conan-recipe-version ] - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831 + 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 }} diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index aa1f5a49f0..6e531ba833 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -42,16 +42,15 @@ env: jobs: default_values: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-default-value.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-default-value.yml@main with: cura_conan_version: ${{ inputs.cura_conan_version }} latest_release: '5.6' latest_release_schedule_hour: 4 latest_release_tag: 'nightly' - # FIXME: point to `main` once merged windows-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@main needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -62,9 +61,8 @@ jobs: operating_system: windows-2022 secrets: inherit - # FIXME: point to `main` once merged linux-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@main needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -75,9 +73,8 @@ jobs: operating_system: ubuntu-22.04 secrets: inherit - # FIXME: point to `main` once merged macos-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} @@ -88,9 +85,8 @@ jobs: operating_system: self-hosted-X64 secrets: inherit - # FIXME: point to `main` once merged macos-arm-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main needs: [ default_values ] with: cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 535d087700..2ad8f90bfe 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -45,9 +45,8 @@ env: STAGING: ${{ inputs.staging || false }} jobs: - # FIXME: point to `main` once merged windows-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@main with: cura_conan_version: ${{ inputs.cura_conan_version }} conan_args: ${{ inputs.conan_args }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 02f45385e7..d080fcc710 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -49,9 +49,8 @@ env: STAGING: ${{ inputs.staging || false }} jobs: - # FIXME: point to `main` once merged windows-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main with: cura_conan_version: ${{ inputs.cura_conan_version }} conan_args: ${{ inputs.conan_args }} diff --git a/.github/workflows/process-pull-request.yml b/.github/workflows/process-pull-request.yml index f34e26f13e..45b3f8c915 100644 --- a/.github/workflows/process-pull-request.yml +++ b/.github/workflows/process-pull-request.yml @@ -4,8 +4,7 @@ on: pull_request_target: types: [ opened, reopened, edited, review_requested, ready_for_review, assigned ] -# FIXME: Use `main` instead of `CURA-10831` once merged jobs: add_label: - uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@main secrets: inherit \ No newline at end of file diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index b4ca2ee699..eaf69692a7 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -6,9 +6,8 @@ on: types: [ completed ] jobs: - # FIXME: Use `main` instead of `CURA-10831` once merged publish-test-results: - uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@main with: event: ${{ github.event.workflow_run.event }} conclusion: ${{ github.event.workflow_run.conclusion }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 6369e7e395..7c6910b39f 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -45,15 +45,13 @@ env: CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} jobs: - # FIXME: Change to `main` instead of `CURA-10831` once merged conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main with: project_name: cura testing: - # FIXME: Change to `main` instead of `CURA-10831` once merged - uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@main needs: [ conan-recipe-version ] with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ef7e986ec3..0007936969 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,9 +45,8 @@ env: STAGING: ${{ inputs.staging || false }} jobs: - # FIXME: point to `main` once merged windows-installer: - uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@main with: cura_conan_version: ${{ inputs.cura_conan_version }} conan_args: ${{ inputs.conan_args }} diff --git a/conandata.yml b/conandata.yml index 0eec369c96..a28954bb3f 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,18 +1,18 @@ version: "5.7.0-alpha.0" requirements: - - "uranium/(latest)@ultimaker/cura_10831" - - "curaengine/(latest)@ultimaker/cura_10831" - - "cura_binary_data/(latest)@ultimaker/cura_10831" - - "fdm_materials/(latest)@ultimaker/cura_10831" - - "curaengine_plugin_gradual_flow/(latest)@ultimaker/cura_10831" - - "dulcificum/(latest)@ultimaker/cura_10831" + - "uranium/(latest)@ultimaker/latest" + - "curaengine/(latest)@ultimaker/latest" + - "cura_binary_data/(latest)@ultimaker/latest" + - "fdm_materials/(latest)@ultimaker/latest" + - "curaengine_plugin_gradual_flow/(latest)@ultimaker/stable" + - "dulcificum/(latest)@ultimaker/latest" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" - - "curaengine_grpc_definitions/(latest)@ultimaker/cura_10831" + - "curaengine_grpc_definitions/(latest)@ultimaker/latest" requirements_internal: - - "fdm_materials/(latest)@internal/cura_10831" - - "cura_private_data/(latest)@internal/cura_10831" + - "fdm_materials/(latest)@internal/latest" + - "cura_private_data/(latest)@internal/latest" urls: default: cloud_api_root: "https://api.ultimaker.com" From d9b75cedef53cc581c61a78d11f862e8540ed234 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 15:07:41 +0100 Subject: [PATCH 41/41] point to testing Contributes to CURA-10831 --- conandata.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conandata.yml b/conandata.yml index a28954bb3f..c4dd1ce6de 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,18 +1,18 @@ version: "5.7.0-alpha.0" requirements: - - "uranium/(latest)@ultimaker/latest" - - "curaengine/(latest)@ultimaker/latest" - - "cura_binary_data/(latest)@ultimaker/latest" - - "fdm_materials/(latest)@ultimaker/latest" + - "uranium/(latest)@ultimaker/testing" + - "curaengine/(latest)@ultimaker/testing" + - "cura_binary_data/(latest)@ultimaker/testing" + - "fdm_materials/(latest)@ultimaker/testing" - "curaengine_plugin_gradual_flow/(latest)@ultimaker/stable" - - "dulcificum/(latest)@ultimaker/latest" + - "dulcificum/(latest)@ultimaker/testing" - "pyarcus/5.3.0" - "pysavitar/5.3.0" - "pynest2d/5.3.0" - - "curaengine_grpc_definitions/(latest)@ultimaker/latest" + - "curaengine_grpc_definitions/(latest)@ultimaker/testing" requirements_internal: - - "fdm_materials/(latest)@internal/latest" - - "cura_private_data/(latest)@internal/latest" + - "fdm_materials/(latest)@internal/testing" + - "cura_private_data/(latest)@internal/testing" urls: default: cloud_api_root: "https://api.ultimaker.com"