Browse Source

Merge branch 'main' into GH-12582_fix_uninstall_by_other

# Conflicts:
#	packaging/NSIS/Ultimaker-Cura.nsi.jinja
Jelle Spijker 2 years ago
parent
commit
cee219f65b

+ 37 - 10
.github/workflows/conan-package-create.yml

@@ -7,6 +7,10 @@ on:
                 required: true
                 type: string
 
+            recipe_id_latest:
+                required: false
+                type: string
+
             runs_on:
                 required: true
                 type: string
@@ -28,6 +32,16 @@ on:
                 type: boolean
                 default: false
 
+            conan_upload_community:
+                required: false
+                default: true
+                type: boolean
+
+            create_from_source:
+                required: false
+                default: false
+                type: boolean
+
 env:
     CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
     CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
@@ -72,7 +86,7 @@ jobs:
                     path: |
                         $HOME/.conan/data
                         $HOME/.conan/conan_download_cache
-                    key: conan-${{ runner.os }}-${{ runner.arch }}
+                    key: conan-${{ runner.os }}-${{ runner.arch }}-create-cache
 
             -   name: Cache Conan local repository packages (Powershell)
                 uses: actions/cache@v3
@@ -82,7 +96,7 @@ jobs:
                         C:\Users\runneradmin\.conan\data
                         C:\.conan
                         C:\Users\runneradmin\.conan\conan_download_cache
-                    key: conan-${{ runner.os }}-${{ runner.arch }}
+                    key: conan-${{ runner.os }}-${{ runner.arch }}-create-cache
 
             -   name: Install MacOS system requirements
                 if:  ${{ runner.os == 'Macos' }}
@@ -90,11 +104,7 @@ jobs:
 
             -   name: Install Linux system requirements
                 if: ${{ runner.os == 'Linux' }}
-                run: sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y
-
-            -   name: Clean Conan local cache
-                if: ${{ inputs.conan_clean_local_cache }}
-                run: conan remove "*" -f
+                run: sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
 
             -   name: Get Conan configuration from branch
                 if: ${{ inputs.conan_config_branch != '' }}
@@ -105,10 +115,27 @@ jobs:
                 run: conan config install https://github.com/Ultimaker/conan-config.git
 
             -   name: Create the Packages
+                if: ${{ !inputs.create_from_source }}
                 run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
 
+            -   name: Create the Packages (from source)
+                if: ${{ inputs.create_from_source }}
+                run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
+
+            -   name: Remove the latest alias
+                if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
+                run: |
+                    conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
+                    conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
+
+            -   name: Create the latest alias
+                if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && always() }}
+                run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
+
             -   name: Upload the Package(s)
                 if: always()
-                run: |
-                    conan upload "*" -r cura --all -c
-                    conan upload "*" -r cura-ce -c
+                run: conan upload "*" -r cura --all -c
+
+            -   name: Upload the Package(s) community
+                if: ${{ always() && inputs.conan_upload_community == 'true' }}
+                run: conan upload "*" -r cura-ce -c

+ 10 - 16
.github/workflows/conan-package.yml

@@ -41,64 +41,58 @@ on:
         branches:
             - main
             - 'CURA-*'
-            - '[1-9]+.[0-9]+'
+            - '[0-9]+.[0-9]+'
         tags:
             - '[0-9]+.[0-9]+.[0-9]+'
             - '[0-9]+.[0-9]+-beta'
 
 jobs:
     conan-recipe-version:
-        uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@5.1
+        uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
         with:
             project_name: cura
 
     conan-package-export-macos:
         needs: [ conan-recipe-version ]
-        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@5.1
+        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
         with:
             recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
             recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
-            recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
             runs_on: 'macos-10.15'
-            python_version: '3.10.4'
-            conan_config_branch: 'master'
+            python_version: '3.10.x'
             conan_logging_level: 'info'
             conan_export_binaries: true
         secrets: inherit
 
     conan-package-export-linux:
         needs: [ conan-recipe-version ]
-        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@5.1
+        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
         with:
             recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
             recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
-            recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
             runs_on: 'ubuntu-20.04'
-            python_version: '3.10.4'
-            conan_config_branch: 'master'
+            python_version: '3.10.x'
             conan_logging_level: 'info'
             conan_export_binaries: true
         secrets: inherit
 
     conan-package-export-windows:
         needs: [ conan-recipe-version ]
-        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@5.1
+        uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
         with:
             recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
             recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
-            recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
             runs_on: 'windows-2022'
-            python_version: '3.10.4'
-            conan_config_branch: 'master'
+            python_version: '3.10.x'
             conan_logging_level: 'info'
             conan_export_binaries: true
         secrets: inherit
 
     notify-export:
         if: ${{ always() }}
-        needs: [ conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ]
+        needs: [ conan-recipe-version, conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ]
 
-        uses: ultimaker/cura/.github/workflows/notify.yml@5.1
+        uses: ultimaker/cura/.github/workflows/notify.yml@main
         with:
             success: ${{ contains(join(needs.*.result, ','), 'success') }}
             success_title: "New Conan recipe exported in ${{ github.repository }}"

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

@@ -11,10 +11,6 @@ on:
                 required: false
                 type: string
 
-            recipe_id_pr:
-                required: false
-                type: string
-
             runs_on:
                 required: true
                 type: string
@@ -35,6 +31,11 @@ on:
                 required: false
                 type: boolean
 
+            conan_upload_community:
+                required: false
+                default: true
+                type: boolean
+
 env:
     CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
     CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
@@ -68,7 +69,7 @@ jobs:
                 uses: actions/cache@v3
                 with:
                     path: $HOME/.conan/data
-                    key: ${{ runner.os }}-conan
+                    key: ${{ runner.os }}-conan-export-cache
 
             -   name: Get Conan configuration from branch
                 if: ${{ inputs.conan_config_branch != '' }}
@@ -83,19 +84,23 @@ jobs:
                 run: conan export-pkg . ${{ inputs.recipe_id_full }}
 
             -   name: Export the Package
-                if: ${{ inputs.conan_export_binaries != 'true' && github.event_name != 'pull_request' }}
+                if: ${{ inputs.conan_export_binaries != 'true' }}
                 run: conan export . ${{ inputs.recipe_id_full }}
 
-            -   name: Create the latest alias
-                if: ${{ inputs.recipe_id_latest != '' && github.event_name != 'pull_request' }}
-                run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
+            -   name: Remove the latest alias
+                if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
+                run: |
+                    conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
+                    conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
 
-            -   name: Create the pull request alias
-                if: ${{ inputs.recipe_id_pr != '' && github.event_name == 'pull_request' }}
+            -   name: Create the latest alias
+                if: ${{ inputs.recipe_id_latest != '' && always() }}
                 run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
 
             -   name: Upload the Package(s)
-                run: |
-                    # Only use --all (upload binaries) for the cura repository
-                    conan upload "*" -r cura --all -c
-                    conan upload "*" -r cura-ce -c
+                if: always()
+                run: conan upload "*" -r cura --all -c
+
+            -   name: Upload the Package(s) community
+                if: ${{ always() && inputs.conan_upload_community == 'true' }}
+                run: conan upload "*" -r cura-ce -c

+ 128 - 64
.github/workflows/conan-recipe-version.yml

@@ -20,16 +20,28 @@ on:
                 description: "The full semver <Major>.<Minor>.<Patch>-<PreReleaseTag>+<BuildMetaData>"
                 value: ${{ jobs.get-semver.outputs.semver_full }}
 
+            is_release_branch:
+                description: "is current branch a release branch?"
+                value: ${{ jobs.get-semver.outputs.release_branch }}
+
+            recipe_user:
+                description: "The conan user"
+                value: ${{ jobs.get-semver.outputs.user }}
+
+            recipe_channel:
+                description: "The conan channel"
+                value: ${{ jobs.get-semver.outputs.channel }}
+
 jobs:
     get-semver:
 
         runs-on: ubuntu-latest
 
         outputs:
-            recipe_id_full: ${{ inputs.project_name }}/${{ steps.get-conan-broadcast-data.outputs.version }}@${{ steps.get-conan-broadcast-data.outputs.user }}/${{ steps.get-conan-broadcast-data.outputs.channel }}
-            recipe_id_latest: ${{ steps.latest-alias.outputs.recipe_id_latest }}
-            recipe_id_pr: ${{ steps.pr-alias.outputs.recipe_id_pr }}
-            semver_full: ${{ steps.get-conan-broadcast-data.outputs.version }}
+            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 }}
 
@@ -40,69 +52,121 @@ jobs:
                     ref: ${{ github.head_ref }}
                     fetch-depth: 0
 
-            -   name: Install GitVersion
-                uses: gittools/actions/gitversion/setup@v0.9.13
+            -   name: Setup Python and pip
+                uses: actions/setup-python@v4
                 with:
-                    versionSpec: '5.x'
+                    python-version: "3.10.x"
+                    cache: 'pip'
+                    cache-dependency-path: .github/workflows/requirements-conan-package.txt
 
-            -   name: GitTools
-                id: git-tool
-                uses: gittools/actions/gitversion/execute@v0.9.13
+            -   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: |
-                    if [ "${{ github.ref_type == 'tag' && github.ref_name == '${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}' }}" = "true" ]; then
-                      # tagged commits on a release branch matching the major.minor.patch are actual released version and should have no user and channel
-                      # name/major.minor.patch@_/_
-                      echo '::set-output name=user::_'
-                      echo '::set-output name=channel::_'
-                      echo '::set-output name=version::${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}'
-                    elif [ "${{ github.ref_type == 'tag' && github.ref_name == '${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}-BETA' }}" = "true" ]; then
-                      # tagged commits with major.minor.patch-BETA on a release branch are actual released version and should have no user and channel
-                      # name/major.minor.patch-beta@_/_
-                      echo '::set-output name=user::_'
-                      echo '::set-output name=channel::_'
-                      echo '::set-output name=version::${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}-${{ steps.git-tool.outputs.PreReleaseLabel }}'                    
-                    elif [ "${{ github.ref_name == 'main' || github.ref_name == 'master' }}" = "true" ]; then
-                      # commits on main/master are alpha's (nightlies) and are considered testing
-                      # name/major.minor.patch-alpha+build@ultimaker/testing
-                      echo ${{ github.repository_owner }} | awk '{print "::set-output name=user::"tolower($0)}'
-                      echo '::set-output name=channel::testing'
-                      echo '::set-output name=version::${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}-${{ steps.git-tool.outputs.PreReleaseLabel }}+${{ steps.git-tool.outputs.BuildMetaData }}'
-                    elif [ "${{ github.ref_name == '5.1' }}" = "true" ]; then
-                      # commits on release branches are beta's and are considered stable
-                      # name/major.minor.patch-beta+build@ultimaker/stable
-                      # FIXME: For release branches: maybe rename the branch to release/**
-                      echo ${{ github.repository_owner }} | awk '{print "::set-output name=user::"tolower($0)}'
-                      echo '::set-output name=channel::stable'    
-                      echo '::set-output name=version::${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}-${{ steps.git-tool.outputs.PreReleaseLabel }}+${{ steps.git-tool.outputs.BuildMetaData }}'
-                    else
-                      # commits on other branches are considered unstable and for development purposes only
-                      # Use the Cura branch naming scheme CURA-1234_foo_bar
-                      # we use the first 9 characters of the branch name
-                      # name/major.minor.patch-beta+build@ultimaker/cura_<jira_number>
-                      echo ${{ github.repository_owner }} | awk '{print "::set-output name=user::"tolower($0)}'
-                      branch=${{ github.ref_name }}
-                      sanitized_branch="${branch//-/_}"
-                      echo $sanitized_branch | awk '{print "::set-output name=channel::"substr(tolower($0),0,9)}'
-                      echo '::set-output version=${{ steps.git-tool.outputs.Major }}.${{ steps.git-tool.outputs.Minor }}.${{ steps.git-tool.outputs.Patch }}-${{ steps.git-tool.outputs.PreReleaseLabel }}+${{ steps.git-tool.outputs.BuildMetaData }}'
-                    fi
-
-            -   name: Get pull request alias
-                id: pr-alias
-                run: |
-                    if [ "${{ github.event_name == 'pull_request' }}" = "true" ]; then
-                      # pull request events are considered unstable and are for testing purposes
-                      # name/latest@ultimaker/pr_<number>
-                      echo "::set-output name=recipe_id_pr::${{ inputs.project_name }}/latest@${{ steps.get-conan-broadcast-data.outputs.user }}/pr_$PR_NUMBER"
-                    else
-                      echo "::set-output name=recipe_id_pr::''"
-                    fi
-                env:
-                    PR_NUMBER: ${{ github.event.issue.number }}
-
-            -   name: Get latest alias
-                id: latest-alias
-                run: |
-                    echo "::set-output name=recipe_id_latest::${{ inputs.project_name }}/latest@${{ steps.get-conan-broadcast-data.outputs.user }}/${{ steps.get-conan-broadcast-data.outputs.channel }}"
+                    import subprocess
+                    from conans import tools
+                    from conans.errors import ConanException
+                    from git import Repo
+                    
+                    repo = Repo('.')
+                    user = "${{ github.repository_owner }}".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
+                    
+                    # FIXME: for when we push a tag (such as an release)
+                    channel = "testing"
+                    if is_tag:
+                        branch_version = tools.Version("${{ github.ref_name }}")
+                        is_release_branch = True
+                        channel = "_"
+                        user = "_"
+                    else:
+                        try:
+                            branch_version = tools.Version(repo.active_branch.name)
+                        except ConanException:
+                            branch_version = tools.Version('0.0.0')
+                        if "${{ github.ref_name }}" == f"{branch_version.major}.{branch_version.minor}":
+                            channel = 'stable'
+                            is_release_branch = True
+                        elif "${{ github.ref_name }}" in ("main", "master"):
+                            channel = 'testing'
+                        else:
+                            channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower()
+                    
+                        if event_name == "pull_request":
+                            channel = f"pr_{issue_number}"
+                    
+                    # %% Get the actual version
+                    latest_branch_version = tools.Version("0.0.0")
+                    latest_branch_tag = None
+                    for tag in repo.git.tag(merged = True).splitlines():
+                        try:
+                            version = tools.Version(tag)
+                        except ConanException:
+                            continue
+                        if version > latest_branch_version:
+                            latest_branch_version = version
+                            latest_branch_tag = repo.tag(tag)
+                    
+                    # %% Get the actual version
+                    no_commits = 0
+                    for commit in repo.iter_commits("HEAD"):
+                        if commit == latest_branch_tag.commit:
+                            break
+                        no_commits += 1
+                    
+                    if no_commits == 0:
+                        # This is a release
+                        actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}"
+                        if channel == "stable":
+                            user = "_"
+                            channel = "_"
+                    else:
+                        if event_name == "pull_request":
+                            actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+pr_{issue_number}_{no_commits}"
+                        else:
+                            if channel in ("stable", "_", ""):
+                                channel_metadata = f"{no_commits}"
+                            else:
+                                channel_metadata = f"{channel}_{no_commits}"
+                            # FIXME: for when we create a new release branch
+                            if latest_branch_version.prerelease == "":
+                                bump_up_minor = int(latest_branch_version.minor) + 1
+                                actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{latest_branch_version.patch}-alpha+{channel_metadata}"
+                            else:
+                                actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{channel_metadata}"
+                    
+                    # %% print to output
+                    cmd_name = ["echo", f"::set-output name=name::{project_name}"]
+                    subprocess.call(cmd_name)
+                    cmd_version = ["echo", f"::set-output name=version::{actual_version}"]
+                    subprocess.call(cmd_version)
+                    cmd_channel = ["echo", f"::set-output name=channel::{channel}"]
+                    subprocess.call(cmd_channel)
+                    cmd_id_full= ["echo", f"::set-output name=recipe_id_full::{project_name}/{actual_version}@{user}/{channel}"]
+                    subprocess.call(cmd_id_full)
+                    cmd_id_latest = ["echo", f"::set-output name=recipe_id_latest::{project_name}/latest@{user}/{channel}"]
+                    subprocess.call(cmd_id_latest)
+                    cmd_semver_full = ["echo", f"::set-output name=semver_full::{actual_version}"]
+                    subprocess.call(cmd_semver_full)
+                    cmd_is_release_branch = ["echo", f"::set-output name=is_release_branch::{str(is_release_branch).lower()}"]
+                    subprocess.call(cmd_is_release_branch)
+                    
+                    print("::group::Conan Recipe Information")
+                    print(f"name = {project_name}")
+                    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::")
+                shell: python

+ 53 - 14
.github/workflows/cura-installer.yml

@@ -5,9 +5,12 @@ on:
         inputs:
             cura_conan_version:
                 description: 'Cura Conan Version'
-                # Fixme: default to cura/latest@testing (which is main)
-                default: 'cura/latest@ultimaker/stable'
+                default: 'cura/latest@ultimaker/testing'
                 required: true
+            conan_args:
+                description: 'Conan args: eq.: --require-override'
+                default: ''
+                required: false
             conan_config:
                 description: 'Conan config branch to use'
                 default: ''
@@ -57,7 +60,11 @@ jobs:
         strategy:
             fail-fast: false
             matrix:
-                os: [ macos-10.15, windows-2022, ubuntu-20.04 ]
+                include:
+                    - { os: macos-10.15, os_id: 'MacOS' }
+                    - { os: windows-2022, os_id: 'Windows' }
+                    - { os: ubuntu-20.04, os_id: 'Linux' }
+                    - { os: ubuntu-22.04, os_id: 'Linux-latest' }
 
         steps:
             -   name: Checkout
@@ -90,7 +97,7 @@ jobs:
                     path: |
                         $HOME/.conan/data
                         $HOME/.conan/conan_download_cache
-                    key: conan-${{ runner.os }}-${{ runner.arch }}
+                    key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache
 
             -   name: Cache Conan local repository packages (Powershell)
                 uses: actions/cache@v3
@@ -100,7 +107,7 @@ jobs:
                         C:\Users\runneradmin\.conan\data
                         C:\.conan
                         C:\Users\runneradmin\.conan\conan_download_cache
-                    key: conan-${{ runner.os }}-${{ runner.arch }}
+                    key: conan-${{ runner.os }}-${{ runner.arch }}-installer-cache
 
             -   name: Install MacOS system requirements
                 if:  ${{ runner.os == 'Macos' }}
@@ -109,7 +116,7 @@ jobs:
             -   name: Install Linux system requirements
                 if: ${{ runner.os == 'Linux' }}
                 run: |
-                    sudo apt install build-essential checkinstall zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y
+                    sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
                     wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool
                     chmod +x $GITHUB_WORKSPACE/appimagetool
                     echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
@@ -139,7 +146,7 @@ jobs:
                 run: conan config install https://github.com/Ultimaker/conan-config.git
 
             -   name: Create the Packages
-                run: conan install ${{ inputs.cura_conan_version }} --build=missing --update -c tools.env.virtualenv:powershell=True -if cura_inst -g VirtualPythonEnv -o cura:enterprise=${{ inputs.enterprise }} -o cura:staging=${{ inputs.staging }} --json "cura_inst/conan_install_info.json"
+                run: conan install ${{ inputs.cura_conan_version }} ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=${{ inputs.enterprise }} -o cura:staging=${{ inputs.staging }} --json "cura_inst/conan_install_info.json"
 
             -   name: Set Environment variables for Cura (bash)
                 if: ${{ runner.os != 'Windows' }}
@@ -159,40 +166,59 @@ jobs:
                 env:
                     TEMP_KEYCHAIN_PASSWORD: ${{  steps.macos-keychain.outputs.keychain-password }}
 
+                # FIXME: This is a workaround to ensure that we use and pack a shared library for OpenSSL 1.1.1l. We currently compile
+                #  OpenSSL statically for CPython, but our Python Dependenies (such as PyQt6) require a shared library.
+                #  Because Conan won't allow for building the same library with two different options (easily) we need to install it explicitly
+                #  and do a manual copy to the VirtualEnv, such that Pyinstaller can find it.
+
+            -   name: Install OpenSSL shared
+                run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy
+
+            -   name: Copy OpenSSL shared (Bash)
+                if: ${{ runner.os != 'Windows' }}
+                run: |
+                    cp ./openssl/lib/*.so* ./cura_inst/bin/ || true
+                    cp ./openssl/lib/*.dylib* ./cura_inst/bin/ || true                    
+
+            -   name: Copy OpenSSL shared (Powershell)
+                if: ${{ runner.os == 'Windows' }}
+                run: |
+                    cp openssl/bin/*.dll ./cura_inst/Scripts/
+                    cp openssl/lib/*.lib ./cura_inst/Lib/
+
             -   name: Create the Cura dist
                 run: pyinstaller ./cura_inst/Ultimaker-Cura.spec
 
             -   name: Archive the artifacts (bash)
                 if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
-                run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/"
+                run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/"
                 working-directory: dist
 
             -   name: Archive the artifacts (Powershell)
                 if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
-                run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.zip"
+                run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.zip"
                 working-directory: dist
 
             -   name: Create the Windows exe installer (Powershell)
                 if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
                 run: |
-                    python ..\cura_inst\packaging\NSIS\nsis-configurator.py ".\Ultimaker-Cura" "..\cura_inst\packaging\NSIS\Ultimaker-Cura.nsi.jinja" "Ultimaker Cura" "Ultimaker-Cura.exe" "$Env:CURA_VERSION_MAJOR" "$Env:CURA_VERSION_MINOR" "$Env:CURA_VERSION_PATCH" "$Env:CURA_VERSION_BUILD" "Ultimaker B.V." "https://ultimaker.com" "..\cura_inst\packaging\cura_license.txt" "LZMA" "..\cura_inst\packaging\NSIS\cura_banner_nsis.bmp" "..\cura_inst\packaging\icons\Cura.ico" "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.exe"
-                    makensis /V2 /P4 Ultimaker-Cura.nsi
+                    python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.exe"
                 working-directory: dist
 
             -   name: Create the Linux AppImage (Bash)
                 if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
-                run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.AppImage"
+                run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.AppImage"
                 working-directory: dist
 
             -   name: Create the MacOS dmg (Bash)
                 if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
-                run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.dmg"
+                run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.dmg"
                 working-directory: dist
 
             -   name: Upload the artifacts
                 uses: actions/upload-artifact@v3
                 with:
-                    name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ runner.os }}-${{ runner.arch }}
+                    name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}-${{ runner.arch }}
                     path: |
                         dist/*.tar.gz
                         dist/*.zip
@@ -202,3 +228,16 @@ jobs:
                         dist/*.AppImage
                         dist/*.asc
                     retention-days: 2
+
+    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

+ 2 - 2
.github/workflows/notify.yml

@@ -36,7 +36,7 @@ jobs:
                 uses: rtCamp/action-slack-notify@v2
                 env:
                     SLACK_USERNAME: ${{ github.repository }}
-                    SLACK_COLOR: #00ff00
+                    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 }}
@@ -47,7 +47,7 @@ jobs:
                 uses: rtCamp/action-slack-notify@v2
                 env:
                     SLACK_USERNAME: ${{ github.repository }}
-                    SLACK_COLOR: #ff0000
+                    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 }}

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

@@ -1,2 +1,2 @@
 conan
-sip==6.5.1
+sip==6.5.1

+ 33 - 6
.github/workflows/unit-test.yml

@@ -62,7 +62,7 @@ env:
 
 jobs:
     conan-recipe-version:
-        uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@5.1
+        uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
         with:
             project_name: cura
 
@@ -71,7 +71,7 @@ jobs:
         needs: [ conan-recipe-version ]
 
         steps:
-            -   name: Checkout CuraEngine
+            -   name: Checkout
                 uses: actions/checkout@v3
 
             -   name: Setup Python and pip
@@ -99,7 +99,7 @@ jobs:
                     path: |
                         $HOME/.conan/data
                         $HOME/.conan/conan_download_cache
-                    key: conan-${{ runner.os }}-${{ runner.arch }}
+                    key: conan-${{ runner.os }}-${{ runner.arch }}-unit-cache
 
             -   name: Install Linux system requirements
                 if: ${{ runner.os == 'Linux' }}
@@ -125,13 +125,40 @@ jobs:
                     pytest --junitxml=junit_cura.xml
                 working-directory: tests
 
+            -   name: Upload Test Results
+                if: always()
+                uses: actions/upload-artifact@v3
+                with:
+                    name: Test Results
+                    path: "tests/**/*.xml"
+
+    publish-test-results:
+        runs-on: ubuntu-20.04
+        needs: [ testing ]
+        if: success() || failure()
+
+        steps:
+            -   name: Checkout
+                uses: actions/checkout@v3
+
+            -   name: Setup Python and pip
+                uses: actions/setup-python@v4
+                with:
+                    python-version: '3.10.x'
+                    architecture: 'x64'
+                    cache: 'pip'
+                    cache-dependency-path: .github/workflows/requirements-conan-package.txt
+
+            -   name: Download Artifacts
+                uses: actions/download-artifact@v3
+                with:
+                    path: artifacts
+
             -   name: Publish Unit Test Results
                 id: test-results
                 uses: EnricoMi/publish-unit-test-result-action@v1
-                if: ${{ always() }}
                 with:
-                    files: |
-                        tests/*.xml
+                    files: "artifacts/**/*.xml"
 
             -   name: Conclusion
                 run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"

+ 1 - 1
.gitignore

@@ -98,4 +98,4 @@ conan_imports_manifest.txt
 conanbuildinfo.txt
 graph_info.json
 Ultimaker-Cura.spec
-/.run/
+.run/

+ 14 - 1
GitVersion.yml

@@ -26,7 +26,7 @@ branches:
         is-mainline: false
         pre-release-weight: 0
     release:
-        regex: ^[\d].[\d]$
+        regex: ^[\d]+\.[\d]+$
         mode: ContinuousDelivery
         tag: beta
         increment: None
@@ -37,6 +37,19 @@ branches:
         is-release-branch: true
         is-mainline: false
         pre-release-weight: 30000
+    pull-request-main:
+        regex: ^(pull|pull\-requests|pr)[/-]
+        mode: ContinuousDelivery
+        tag: alpha+
+        increment: Inherit
+        prevent-increment-of-merged-branch-version: true
+        tag-number-pattern: '[/-](?<number>\d+)[-/]'
+        track-merge-target: true
+        source-branches: [ 'main' ]
+        tracks-release-branches: false
+        is-release-branch: false
+        is-mainline: false
+        pre-release-weight: 30000
 ignore:
     sha: [ ]
 merge-message-formats: { }

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