conan-recipe-export.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. name: Export Conan Recipe to server
  2. on:
  3. workflow_call:
  4. inputs:
  5. recipe_id_full:
  6. required: true
  7. type: string
  8. recipe_id_latest:
  9. required: false
  10. type: string
  11. runs_on:
  12. required: true
  13. type: string
  14. python_version:
  15. required: true
  16. type: string
  17. conan_config_branch:
  18. required: false
  19. type: string
  20. conan_logging_level:
  21. required: false
  22. type: string
  23. conan_export_binaries:
  24. required: false
  25. type: boolean
  26. conan_upload_community:
  27. required: false
  28. default: true
  29. type: boolean
  30. env:
  31. CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
  32. CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
  33. CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
  34. CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
  35. CONAN_LOG_RUN_TO_OUTPUT: 1
  36. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  37. CONAN_NON_INTERACTIVE: 1
  38. jobs:
  39. package-export:
  40. runs-on: ${{ inputs.runs_on }}
  41. steps:
  42. - name: Checkout project
  43. uses: actions/checkout@v3
  44. - name: Setup Python and pip
  45. uses: actions/setup-python@v4
  46. with:
  47. python-version: ${{ inputs.python_version }}
  48. cache: 'pip'
  49. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  50. - name: Install Python requirements and Create default Conan profile
  51. run: |
  52. pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
  53. conan profile new default --detect
  54. # Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
  55. - name: Cache Conan local repository packages
  56. uses: actions/cache@v3
  57. with:
  58. path: $HOME/.conan/data
  59. key: ${{ runner.os }}-conan-export-cache
  60. - name: Get Conan configuration from branch
  61. if: ${{ inputs.conan_config_branch != '' }}
  62. run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
  63. - name: Get Conan configuration
  64. if: ${{ inputs.conan_config_branch == '' }}
  65. run: conan config install https://github.com/Ultimaker/conan-config.git
  66. - name: Export the Package (binaries)
  67. if: ${{ inputs.conan_export_binaries }}
  68. run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
  69. - name: Export the Package
  70. if: ${{ !inputs.conan_export_binaries }}
  71. run: conan export . ${{ inputs.recipe_id_full }}
  72. - name: Remove the latest alias
  73. if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
  74. run: |
  75. conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
  76. conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
  77. - name: Create the latest alias
  78. if: ${{ inputs.recipe_id_latest != '' && always() }}
  79. run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
  80. - name: Upload the Package(s)
  81. if: always()
  82. run: conan upload "*" -r cura --all -c
  83. - name: Upload the Package(s) community
  84. if: ${{ always() && inputs.conan_upload_community == true }}
  85. run: conan upload "*" -r cura-ce -c