conan-package.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ---
  2. name: conan-package
  3. # Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can
  4. # be used downstream.
  5. #
  6. # It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches
  7. on:
  8. workflow_dispatch:
  9. inputs:
  10. create_binaries_windows:
  11. required: true
  12. default: false
  13. description: 'create binaries Windows'
  14. create_binaries_linux:
  15. required: true
  16. default: false
  17. description: 'create binaries Linux'
  18. create_binaries_macos:
  19. required: true
  20. default: false
  21. description: 'create binaries Macos'
  22. push:
  23. paths:
  24. - 'plugins/**'
  25. - 'resources/**'
  26. - 'cura/**'
  27. - 'icons/**'
  28. - 'tests/**'
  29. - 'packaging/**'
  30. - '.github/workflows/conan-*.yml'
  31. - '.github/workflows/notify.yml'
  32. - '.github/workflows/requirements-conan-package.txt'
  33. - 'requirements*.txt'
  34. - 'conanfile.py'
  35. - 'conandata.yml'
  36. - 'GitVersion.yml'
  37. - '*.jinja'
  38. branches:
  39. - main
  40. - 'CURA-*'
  41. - '[1-9].[0-9]'
  42. - '[1-9].[0-9][0-9]'
  43. tags:
  44. - '[1-9].[0-9].[0-9]*'
  45. - '[1-9].[0-9].[0-9]'
  46. - '[1-9].[0-9][0-9].[0-9]*'
  47. permissions: {}
  48. jobs:
  49. conan-recipe-version:
  50. permissions:
  51. contents: read
  52. uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
  53. with:
  54. project_name: cura
  55. conan-package-export:
  56. permissions:
  57. contents: read
  58. needs: [ conan-recipe-version ]
  59. uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
  60. with:
  61. recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
  62. recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
  63. runs_on: 'ubuntu-20.04'
  64. python_version: '3.10.x'
  65. conan_logging_level: 'info'
  66. secrets: inherit
  67. conan-package-create-linux:
  68. permissions:
  69. contents: read
  70. 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) }}
  71. needs: [ conan-recipe-version, conan-package-export ]
  72. uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
  73. with:
  74. project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
  75. recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
  76. build_id: 1
  77. runs_on: 'ubuntu-20.04'
  78. python_version: '3.10.x'
  79. conan_logging_level: 'info'
  80. secrets: inherit
  81. notify-export:
  82. if: ${{ always() }}
  83. needs: [ conan-recipe-version, conan-package-export ]
  84. uses: ultimaker/cura/.github/workflows/notify.yml@main
  85. with:
  86. success: ${{ contains(join(needs.*.result, ','), 'success') }}
  87. success_title: "New Conan recipe exported in ${{ github.repository }}"
  88. success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  89. failure_title: "Failed to export Conan Export in ${{ github.repository }}"
  90. failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  91. secrets: inherit
  92. notify-create:
  93. 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)) }}
  94. needs: [ conan-recipe-version, conan-package-create-linux ]
  95. uses: ultimaker/cura/.github/workflows/notify.yml@main
  96. with:
  97. success: ${{ contains(join(needs.*.result, ','), 'success') }}
  98. success_title: "New binaries created in ${{ github.repository }}"
  99. success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  100. failure_title: "Failed to create binaries in ${{ github.repository }}"
  101. failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  102. secrets: inherit