From 3062a0bfeb973151fd77a887b58f434b6f16bf8f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:54:22 +0100 Subject: [PATCH 01/10] 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 | 1 + conanfile.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 conandata.yml diff --git a/conandata.yml b/conandata.yml new file mode 100644 index 000000000..16850d180 --- /dev/null +++ b/conandata.yml @@ -0,0 +1 @@ +version: "5.6.0-beta.1" \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index f35d2c142..fb97b8fdf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -22,7 +22,7 @@ class FDM_MaterialsConan(ConanFile): def set_version(self): if not self.version: - self.version = "5.6.0-beta.1" + self.version = self.conan_data["version"] def export_sources(self): copy(self, "*.fdm_material", self.recipe_folder, self.export_sources_folder) From b8acd1ce29b19079434a273ab1bffb1e74db0839 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:59:52 +0100 Subject: [PATCH 02/10] Use cura-workflows to determine version Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 6fbf90bf6..53f11c75a 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -26,7 +26,7 @@ on: jobs: conan-recipe-version: - uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: fdm_materials From d7bc33c0df3a1facc5f361b0383d79527cb8270d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 10:42:04 +0100 Subject: [PATCH 03/10] add release tagging info to conandata Contributes to CURA-10831 --- conandata.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 16850d180..f24ef450c 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1 +1,2 @@ -version: "5.6.0-beta.1" \ No newline at end of file +version: "5.6.0-beta.1" +release: false \ No newline at end of file From 45b57fb4cf52b95ed80da303db722fcaf9151180 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 11:59:55 +0100 Subject: [PATCH 04/10] don't set release from conandata.yml Contributes to CURA-10831 --- conandata.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conandata.yml b/conandata.yml index f24ef450c..16850d180 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,2 +1 @@ -version: "5.6.0-beta.1" -release: false \ No newline at end of file +version: "5.6.0-beta.1" \ No newline at end of file From 39893a0faaa0c49915519af1825d27b723157a63 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 17:22:23 +0100 Subject: [PATCH 05/10] Update conanfile.py and streamline GitHub workflow Added an `export` method in conanfile.py to update the conandata with the current version. Minor modifications were also made to the GitHub workflow, removing redundant job steps and reformatting it for clarity. Version exports are now also disabled in the 'conan-package-export-linux' job. Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 80 +++++++++++------------------ conanfile.py | 5 +- 2 files changed, 33 insertions(+), 52 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 53f11c75a..77dd70122 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -1,57 +1,35 @@ ---- name: conan-package -# Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can -# be used downstream. -# -# It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches - on: - workflow_dispatch: - push: - paths: - - '*.xml.*' - - '*.sig' - - 'conanfile.py' - - '.github/workflows/conan-package.yml' - - '.github/workflows/requirements*.txt' - branches: - - main - - master - - 'CURA-*' - - '[0-9].[0-9]*' - tags: - - '[1-9]+.[0-9]+.[0-9]*' - - '[1-9]+.[0-9]+.[0-9]' + workflow_dispatch: + push: + paths: + - '*.xml.*' + - '*.sig' + - 'conanfile.py' + - '.github/workflows/conan-package.yml' + - '.github/workflows/requirements*.txt' + branches: + - main + - master + - 'CURA-*' + - '[0-9].[0-9]*' + tags: + - '[0-9]+.[0-9]+.[0-9]*' + - '[0-9]+.[0-9]+.[0-9]' +# FIXME: point to `main` once merged jobs: - conan-recipe-version: - uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 - with: - project_name: fdm_materials - - conan-package-export-linux: - needs: [ conan-recipe-version ] - 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 }} - runs_on: 'ubuntu-20.04' - python_version: '3.10.x' - conan_config_branch: 'master' - conan_logging_level: 'info' - conan_export_binaries: true - secrets: inherit - - notify-export: - if: ${{ always() }} - needs: [ conan-recipe-version, conan-package-export-linux ] + conan-recipe-version: + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 + with: + project_name: fdm_materials - 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 + conan-package-export-linux: + needs: [ conan-recipe-version ] + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831 + with: + recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} + recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} + conan_export_binaries: false + secrets: inherit diff --git a/conanfile.py b/conanfile.py index fb97b8fdf..76cb6cf86 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile -from conan.tools.files import copy +from conan.tools.files import copy, update_conandata from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration @@ -24,6 +24,9 @@ def set_version(self): if not self.version: self.version = self.conan_data["version"] + def export(self): + update_conandata(self, {"version": self.version}) + def export_sources(self): copy(self, "*.fdm_material", self.recipe_folder, self.export_sources_folder) copy(self, "*.sig", self.recipe_folder, self.export_sources_folder) From 404e04231437c211de49af5e7908bd3f689d36a1 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 15 Nov 2023 14:17:55 +0100 Subject: [PATCH 06/10] Remove export binaries option Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 77dd70122..2e9596667 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -31,5 +31,4 @@ jobs: with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} - conan_export_binaries: false secrets: inherit From 32dd6569fd3d172f76c8d25df5072417913582d0 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 15 Nov 2023 14:32:26 +0100 Subject: [PATCH 07/10] also run on PP branches Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 2e9596667..9ba20e982 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -12,6 +12,7 @@ on: branches: - main - master + - 'PP-*' - 'CURA-*' - '[0-9].[0-9]*' tags: From b31b728769799ceb66eb94560ac15a080474620b Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 27 Nov 2023 08:10:34 +0100 Subject: [PATCH 08/10] Merge main and update versions Contribute to CURA-10831 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 16850d180..fa35d3cda 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1 +1 @@ -version: "5.6.0-beta.1" \ No newline at end of file +version: "5.7.0-alpha.0" \ No newline at end of file From fcd9c036fe3b9e2adcc91f75135041b7598127fe Mon Sep 17 00:00:00 2001 From: jellespijker Date: Fri, 1 Dec 2023 16:26:28 +0100 Subject: [PATCH 09/10] 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 56fb015b9..f34e26f13 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:' + add_label: + uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@CURA-10831 + secrets: inherit \ No newline at end of file From 5f03d653c9b0838754f252d7626a64b86a868b6b Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 14:30:05 +0100 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Casper Lamboo --- .github/workflows/conan-package.yml | 5 ++--- .github/workflows/process-pull-request.yml | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 9ba20e982..98ca25f35 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -19,16 +19,15 @@ on: - '[0-9]+.[0-9]+.[0-9]*' - '[0-9]+.[0-9]+.[0-9]' -# 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: fdm_materials conan-package-export-linux: 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/process-pull-request.yml b/.github/workflows/process-pull-request.yml index f34e26f13..45b3f8c91 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