Browse Source

Merge branch 'main' into PP-249_53_enable-support-brim

Remco Burema 1 year ago
parent
commit
b6926b9a24

+ 13 - 43
.github/workflows/conan-package-create.yml

@@ -51,10 +51,8 @@ on:
                 type: boolean
 
 env:
-    CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
-    CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
-    CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
-    CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
+    CONAN_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
@@ -109,9 +107,13 @@ jobs:
                 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
@@ -141,48 +143,16 @@ jobs:
                 if: ${{ inputs.conan_config_branch == '' }}
                 run: conan config install https://github.com/Ultimaker/conan-config.git
 
-            -   name: Create the lock file
-                if: ${{ inputs.build_info }}
-                run: |
-                    conan_build_info --v2 start ${{ inputs.project_name }} ${{ github.run_number }}000${{ inputs.build_id }}
-                    conan lock create --reference ${{ inputs.recipe_id_full }} --lockfile-out=conan.lock                    
-
-            -   name: Create the Packages using lockfile
-                if: ${{ inputs.build_info }}
-                run: conan install ${{ inputs.recipe_id_full }} --build=missing --update --lockfile=conan.lock --lockfile-out=conan.lock
+            -   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
-                if: ${{ ! inputs.build_info }}
                 run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
 
-            -   name: Create the build info
-                if: ${{ inputs.build_info }}
-                run: conan_build_info --v2 create buildinfo.json --lockfile conan.lock --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
-
             -   name: Upload the Package(s)
-                if: always()
-                run: conan upload "*" -r cura --all -c
-
-            -   name: Upload the build info
-                if: ${{ inputs.build_info }}
-                run: |
-                    conan_build_info --v2 publish buildinfo.json --url https://ultimaker.jfrog.io/artifactory --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
-                    conan_build_info --v2 stop
-
-            -   name: Upload the Package(s) community
-                if: ${{ always() && inputs.conan_upload_community == true }}
-                run: conan upload "*" -r cura-ce -c
+                if: ${{ always() && inputs.conan_upload_community }}
+                run: conan upload ${{ inputs.recipe_id_full }} -r cura --all -c
 
-            -   name: Upload the log and build artifacts
-                if: always()
-                uses: actions/upload-artifact@v3
-                with:
-                    name: log-${{ inputs.runs_on }}-${{ runner.arch }}
-                    path: |
-                        buildinfo.json
-                        conan.lock
-                        conanbuildinfo.txt
-                        conaninfo.txt
-                        graph_info.json
-                        build/**
-                    retention-days: 1
+            -   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

+ 121 - 97
.github/workflows/conan-package.yml

@@ -7,110 +7,134 @@ name: conan-package
 # It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches
 
 on:
-    workflow_dispatch:
-        inputs:
-            create_binaries_windows:
-                required: true
-                default: false
-                description: 'create binaries Windows'
-            create_binaries_linux:
-                required: true
-                default: false
-                description: 'create binaries Linux'
-            create_binaries_macos:
-                required: true
-                default: false
-                description: 'create binaries Macos'
-
-    push:
-        paths:
-            - 'plugins/**'
-            - 'resources/**'
-            - 'cura/**'
-            - 'icons/**'
-            - 'tests/**'
-            - 'packaging/**'
-            - '.github/workflows/conan-*.yml'
-            - '.github/workflows/notify.yml'
-            - '.github/workflows/requirements-conan-package.txt'
-            - 'requirements*.txt'
-            - 'conanfile.py'
-            - 'conandata.yml'
-            - 'GitVersion.yml'
-            - '*.jinja'
-        branches:
-            - main
-            - 'CURA-*'
-            - '[1-9].[0-9]'
-            - '[1-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]*'
+  workflow_dispatch:
+    inputs:
+      create_binaries_windows:
+        required: true
+        default: false
+        description: 'create binaries Windows'
+      create_binaries_linux:
+        required: true
+        default: false
+        description: 'create binaries Linux'
+      create_binaries_macos:
+        required: true
+        default: false
+        description: 'create binaries Macos'
+
+  push:
+    paths:
+      - 'plugins/**'
+      - 'resources/**'
+      - 'cura/**'
+      - 'icons/**'
+      - 'tests/**'
+      - 'packaging/**'
+      - '.github/workflows/conan-*.yml'
+      - '.github/workflows/notify.yml'
+      - '.github/workflows/requirements-conan-package.txt'
+      - 'requirements*.txt'
+      - 'conanfile.py'
+      - 'conandata.yml'
+      - 'GitVersion.yml'
+      - '*.jinja'
+    branches:
+      - main
+      - 'CURA-*'
+      - '[1-9].[0-9]'
+      - '[1-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]*'
+
+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: {}
 jobs:
-    conan-recipe-version:
-        permissions:
-          contents: read
+  conan-recipe-version:
+    permissions:
+      contents: read
 
-        uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
-        with:
-            project_name: cura
+    uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
+    with:
+      project_name: cura
+
+  conan-package-create-linux:
+    needs: [ conan-recipe-version ]
+    runs-on: 'ubuntu-latest'
 
-    conan-package-export:
-        permissions:
-          contents: read
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
 
-        needs: [ conan-recipe-version ]
-        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
+      - name: Cache Conan data
+        id: cache-conan
+        uses: actions/cache@v3
         with:
-            recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
-            recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
-            runs_on: 'ubuntu-20.04'
-            python_version: '3.10.x'
-            conan_logging_level: 'info'
-        secrets: inherit
+          path: ~/.conan
+          key: ${{ runner.os }}-conan
 
-    conan-package-create-linux:
-        permissions:
-          contents: read
+      - 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
 
-        if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
-        needs: [ conan-recipe-version, conan-package-export ]
+      - name: Install Python requirements for runner
+        run: pip install -r .github/workflows/requirements-conan-package.txt
 
-        uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
-        with:
-            project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
-            recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
-            build_id: 1
-            runs_on: 'ubuntu-20.04'
-            python_version: '3.10.x'
-            conan_logging_level: 'info'
-        secrets: inherit
-
-    notify-export:
-        if: ${{ always() }}
-        needs: [ conan-recipe-version, conan-package-export ]
-
-        uses: ultimaker/cura/.github/workflows/notify.yml@main
-        with:
-            success: ${{ contains(join(needs.*.result, ','), 'success') }}
-            success_title: "New Conan recipe exported in ${{ github.repository }}"
-            success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
-            failure_title: "Failed to export Conan Export in ${{ github.repository }}"
-            failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
-        secrets: inherit
-
-    notify-create:
-        if: ${{ always() && ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }}
-        needs: [ conan-recipe-version, conan-package-create-linux ]
-
-        uses: ultimaker/cura/.github/workflows/notify.yml@main
-        with:
-            success: ${{ contains(join(needs.*.result, ','), 'success') }}
-            success_title: "New binaries created in ${{ github.repository }}"
-            success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
-            failure_title: "Failed to create binaries in ${{ github.repository }}"
-            failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
-        secrets: inherit
+      # 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
+          sudo apt install g++-12 gcc-12 -y
+          sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
+          sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
+
+      - name: Create the default Conan profile
+        run: conan profile new default --detect --force
+
+      - name: Get Conan configuration
+        run: conan config install https://github.com/Ultimaker/conan-config.git
+
+      - 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
+
+      - 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
+    with:
+      success: ${{ contains(join(needs.*.result, ','), 'success') }}
+      success_title: "New binaries created in ${{ github.repository }}"
+      success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
+      failure_title: "Failed to create binaries in ${{ github.repository }}"
+      failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
+    secrets: inherit

+ 15 - 16
.github/workflows/conan-recipe-export.yml

@@ -37,10 +37,8 @@ on:
                 type: boolean
 
 env:
-    CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
-    CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
-    CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
-    CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
+    CONAN_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
@@ -80,6 +78,9 @@ jobs:
                 if: ${{ inputs.conan_config_branch == '' }}
                 run: conan config install https://github.com/Ultimaker/conan-config.git
 
+            -   name: Add Cura private Artifactory remote
+                run: conan remote add cura-private https://ultimaker.jfrog.io/artifactory/api/conan/cura-private True
+
             -   name: Export the Package (binaries)
                 if: ${{ inputs.conan_export_binaries }}
                 run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
@@ -88,20 +89,18 @@ jobs:
                 if: ${{ !inputs.conan_export_binaries }}
                 run: conan export . ${{ inputs.recipe_id_full }}
 
-            -   name: Remove the latest alias
-                if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
-                run: |
-                    conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
-                    conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
-
             -   name: Create the latest alias
-                if: ${{ inputs.recipe_id_latest != '' && always() }}
+                if: always()
                 run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
 
             -   name: Upload the Package(s)
-                if: always()
-                run: conan upload "*" -r cura --all -c
+                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) community
-                if: ${{ always() && inputs.conan_upload_community == true }}
-                run: conan upload "*" -r cura-ce -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
+                    conan upload ${{ inputs.recipe_id_latest }} -r cura-private -c

+ 52 - 33
.github/workflows/conan-recipe-version.yml

@@ -7,6 +7,11 @@ on:
                 required: true
                 type: string
 
+            user:
+                required: false
+                default: ultimaker
+                type: string
+
             additional_buildmetadata:
                 required: false
                 default: ""
@@ -86,12 +91,12 @@ jobs:
                 run: |
                     import subprocess
                     import os
-                    from conans import tools
-                    from conans.errors import ConanException
+                    from conan.tools.scm import Version
+                    from conan.errors import ConanException
                     from git import Repo
                     
                     repo = Repo('.')
-                    user = "${{ github.repository_owner }}".lower()
+                    user = "${{ inputs.user }}".lower()
                     project_name = "${{ inputs.project_name }}"
                     event_name = "${{ github.event_name }}"
                     issue_number = "${{ github.ref }}".split('/')[2]
@@ -103,16 +108,16 @@ jobs:
                     # FIXME: for when we push a tag (such as an release)
                     channel = "testing"
                     if is_tag:
-                        branch_version = tools.Version(ref_name)
+                        branch_version = Version(ref_name)
                         is_release_branch = True
                         channel = "_"
                         user = "_"
                         actual_version = f"{branch_version}"
                     else:
                         try:
-                            branch_version = tools.Version(repo.active_branch.name)
+                            branch_version = Version(repo.active_branch.name)
                         except ConanException:
-                            branch_version = tools.Version('0.0.0')
+                            branch_version = Version('0.0.0')
                         if ref_name == f"{branch_version.major}.{branch_version.minor}":
                             channel = 'stable'
                             is_release_branch = True
@@ -125,17 +130,17 @@ jobs:
                             channel = f"pr_{issue_number}"
                     
                         # %% Get the actual version
-                        latest_branch_version = tools.Version("0.0.0")
+                        latest_branch_version = Version("0.0.0")
                         latest_branch_tag = None
-                        for tag in repo.git.tag(merged = True).splitlines():
+                        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 = tools.Version(tag)
+                                version = Version(tag)
                             except ConanException:
                                 continue
-                            if version > latest_branch_version and version < tools.Version("10.0.0"):
-                                # FIXME: stupid old Cura tags 13.04 etc. keep popping up
+                            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)
                         
@@ -146,12 +151,12 @@ jobs:
                                 if commit == latest_branch_tag.commit:
                                     break
                                 no_commits += 1
-                            latest_branch_version_prerelease = latest_branch_version.prerelease
-                            if latest_branch_version.prerelease and not "." in latest_branch_version.prerelease:
+                            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.prerelease}.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}-{latest_branch_version_prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}"
+                                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}_{no_commits}"
                                 channel_metadata = f"{channel}_{no_commits}"
                             else:
                                 if channel in ("stable", "_", ""):
@@ -159,20 +164,34 @@ jobs:
                                 else:
                                     channel_metadata = f"{channel}_{no_commits}"
                             if is_release_branch:
-                                if latest_branch_version.prerelease == "" and branch_version > latest_branch_version:
+                                if latest_branch_version.pre == "" 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.prerelease == "":
+                                elif latest_branch_version.pre == "":
                                     # An actual full release has been created, we are working on patch
-                                    bump_up_patch = int(latest_branch_version.patch) + 1
+                                    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(latest_branch_version.prerelease.split('.')[1]) + 1
-                                    actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.split('.')[0]}.{bump_up_release_tag}+{buildmetadata}{channel_metadata}"
+                                    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:
-                                bump_up_minor = int(latest_branch_version.minor) + 1
-                                reset_patch = 0
-                                actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{reset_patch}-alpha+{buildmetadata}{channel_metadata}"
+                                max_branches_version = Version("0.0.0")
+                                branches_no_commits = no_commits
+                                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
+                                                branches_no_commits = repo.commit().count() - branch.commit.count()
+                                    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}_{branches_no_commits}"
+                                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"]
@@ -191,14 +210,14 @@ jobs:
                         f.writelines(f"semver_full={actual_version}\n")
                         f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n")
                     
-                    print("::group::Conan Recipe Information")
-                    print(f"name = {project_name}")
-                    print(f"version = {actual_version}")
-                    print(f"user = {user}")
-                    print(f"channel = {channel}")
-                    print(f"recipe_id_full = {project_name}/{actual_version}@{user}/{channel}")
-                    print(f"recipe_id_latest = {project_name}/latest@{user}/{channel}")
-                    print(f"semver_full = {actual_version}")
-                    print(f"is_release_branch = {str(is_release_branch).lower()}")
-                    print("::endgroup::")
+                    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

+ 34 - 0
.github/workflows/cura-installer.yml

@@ -122,9 +122,17 @@ jobs:
                 if:  ${{ runner.os == 'Macos' }}
                 run: brew install autoconf automake ninja create-dmg # Delete create-dmg when deprecating dmg
 
+            -   name: Hack needed specifically for ubuntu-22.04 from mid-Feb 2023 onwards
+                if: ${{ runner.os == 'Linux' && startsWith(inputs.platform, 'ubuntu-22.04') }}
+                run: sudo apt remove libodbc2 libodbcinst2 unixodbc-common -y
+
+            # 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
@@ -265,6 +273,32 @@ jobs:
                         f.writelines(f"INSTALLER_EXT={installer_ext}\n")
                         f.writelines(f"FULL_INSTALLER_FILENAME={installer_filename}.{installer_ext}\n")
 
+            -   name: Summarize the used Conan dependencies
+                shell: python
+                run: |
+                    import os
+                    import json
+                    from pathlib import Path
+                                        
+                    conan_install_info_path = Path("cura_inst/conan_install_info.json")
+                    conan_info = {"installed": []}
+                    if os.path.exists(conan_install_info_path):
+                        with open(conan_install_info_path, "r") as f:
+                            conan_info = json.load(f)
+                    sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]])
+                    
+                    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.FULL_INSTALLER_FILENAME }} uses:\n")
+                        for dep in sorted_deps:
+                            f.writelines(f"`{dep}`\n")
+
             -   name: Archive the artifacts (bash)
                 if: ${{ !inputs.installer && runner.os != 'Windows' }}
                 run: tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./UltiMaker-Cura/"

+ 7 - 6
.github/workflows/printer-linter-format.yml

@@ -18,19 +18,20 @@ jobs:
             -   name: Checkout
                 uses: actions/checkout@v3
 
+            -   uses: technote-space/get-diff-action@v6
+                with:
+                    PATTERNS: |
+                        resources/+(definitions|extruders)/*.def.json
+                        resources/+(intent|quality|variants)/**/*.inst.cfg
+
             -   name: Setup Python and pip
+                if: env.GIT_DIFF && !env.MATCHED_FILES  # If nothing happens with python and/or pip after, the clean-up crashes.
                 uses: actions/setup-python@v4
                 with:
                     python-version: 3.11.x
                     cache: 'pip'
                     cache-dependency-path: .github/workflows/requirements-printer-linter.txt
 
-            -   uses: technote-space/get-diff-action@v6
-                with:
-                    PATTERNS: |
-                        resources/+(definitions|extruders)/*.def.json
-                        resources/+(intent|quality|variants)/**/*.inst.cfg
-
             -   name: Install Python requirements for runner
                 if: env.GIT_DIFF && !env.MATCHED_FILES
                 run: pip install -r .github/workflows/requirements-printer-linter.txt

+ 7 - 6
.github/workflows/printer-linter-pr-diagnose.yml

@@ -16,19 +16,20 @@ jobs:
         with:
           fetch-depth: 2
 
+      - uses: technote-space/get-diff-action@v6
+        with:
+          PATTERNS: |
+            resources/+(extruders|definitions)/*.def.json
+            resources/+(intent|quality|variants)/**/*.inst.cfg
+
       - name: Setup Python and pip
+        if: env.GIT_DIFF && !env.MATCHED_FILES  # If nothing happens with python and/or pip after, the clean-up crashes.
         uses: actions/setup-python@v4
         with:
           python-version: 3.11.x
           cache: "pip"
           cache-dependency-path: .github/workflows/requirements-printer-linter.txt
 
-      - uses: technote-space/get-diff-action@v6
-        with:
-          PATTERNS: |
-            resources/+(extruders|definitions)/*.def.json
-            resources/+(intent|quality|variants)/**/*.inst.cfg
-
       - name: Install Python requirements for runner
         if: env.GIT_DIFF && !env.MATCHED_FILES
         run: pip install -r .github/workflows/requirements-printer-linter.txt

+ 1 - 1
.github/workflows/requirements-conan-package.txt

@@ -1,2 +1,2 @@
-conan!=1.51.0,!=1.51.1,!=1.51.2,!=1.51.3,!=1.52.0,!=1.57.0,!=1.58.0
+conan==1.56.0
 sip

+ 71 - 0
.github/workflows/security_badge.yml

@@ -0,0 +1,71 @@
+# NOTE: Best to keep all of these remarks in, they might prove useful in the future.
+#       This is basically just the standard one that is sugested on 'new workflow'.
+
+name: Scorecard supply-chain security
+on:
+  # For Branch-Protection check. Only the default branch is supported. See
+  # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
+  branch_protection_rule:
+  # To guarantee Maintained check is occasionally updated. See
+  # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
+  schedule:
+    - cron: '25 2 * * 5'
+  push:
+    branches: [ "main" ]
+
+# Declare default permissions as read only.
+permissions: read-all
+
+jobs:
+  analysis:
+    name: Scorecard analysis
+    runs-on: ubuntu-latest
+    permissions:
+      # Needed to upload the results to code-scanning dashboard.
+      security-events: write
+      # Needed to publish results and get a badge (see publish_results below).
+      id-token: write
+      # Uncomment the permissions below if installing in a private repository.
+      # contents: read
+      # actions: read
+
+    steps:
+      - name: "Checkout code"
+        uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
+        with:
+          persist-credentials: false
+
+      - name: "Run analysis"
+        uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
+        with:
+          results_file: results.sarif
+          results_format: sarif
+          # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
+          # - you want to enable the Branch-Protection check on a *public* repository, or
+          # - you are installing Scorecard on a *private* repository
+          # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
+          # repo_token: ${{ secrets.SCORECARD_TOKEN }}
+
+          # Public repositories:
+          #   - Publish results to OpenSSF REST API for easy access by consumers
+          #   - Allows the repository to include the Scorecard badge.
+          #   - See https://github.com/ossf/scorecard-action#publishing-results.
+          # For private repositories:
+          #   - `publish_results` will always be set to `false`, regardless
+          #     of the value entered here.
+          publish_results: true
+
+      # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
+      # format to the repository Actions tab.
+      - name: "Upload artifact"
+        uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
+        with:
+          name: SARIF file
+          path: results.sarif
+          retention-days: 5
+
+      # Upload the results to GitHub's code scanning dashboard.
+      - name: "Upload to code-scanning"
+        uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
+        with:
+          sarif_file: results.sarif

+ 1 - 1
.github/workflows/unit-test-post.yml

@@ -79,4 +79,4 @@ jobs:
                     files: "tests/**/*.xml"
 
             -   name: Conclusion
-                run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
+                run: echo "Conclusion is ${{ steps.test-results.outputs.json && fromJSON( steps.test-results.outputs.json ).conclusion }}"

Some files were not shown because too many files changed in this diff