conan-recipe-export.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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: ${{ secrets.CONAN_USER }}
  32. CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}
  33. CONAN_LOG_RUN_TO_OUTPUT: 1
  34. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  35. CONAN_NON_INTERACTIVE: 1
  36. jobs:
  37. package-export:
  38. runs-on: ${{ inputs.runs_on }}
  39. steps:
  40. - name: Checkout project
  41. uses: actions/checkout@v3
  42. - name: Setup Python and pip
  43. uses: actions/setup-python@v4
  44. with:
  45. python-version: ${{ inputs.python_version }}
  46. cache: 'pip'
  47. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  48. - name: Install Python requirements and Create default Conan profile
  49. run: |
  50. pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
  51. conan profile new default --detect
  52. # Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
  53. - name: Cache Conan local repository packages
  54. uses: actions/cache@v3
  55. with:
  56. path: $HOME/.conan/data
  57. key: ${{ runner.os }}-conan-export-cache
  58. - name: Get Conan configuration from branch
  59. if: ${{ inputs.conan_config_branch != '' }}
  60. run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
  61. - name: Get Conan configuration
  62. if: ${{ inputs.conan_config_branch == '' }}
  63. run: conan config install https://github.com/Ultimaker/conan-config.git
  64. - name: Add Cura private Artifactory remote
  65. run: conan remote add cura-private https://ultimaker.jfrog.io/artifactory/api/conan/cura-private True
  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: Create the latest alias
  73. if: always()
  74. run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
  75. - name: Upload the Package(s)
  76. if: ${{ always() && inputs.conan_upload_community }}
  77. run: |
  78. conan upload ${{ inputs.recipe_id_full }} -r cura --all -c
  79. conan upload ${{ inputs.recipe_id_latest }} -r cura -c
  80. - name: Upload the Package(s) to the private Artifactory
  81. if: ${{ always() && ! inputs.conan_upload_community }}
  82. run: |
  83. conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c
  84. conan upload ${{ inputs.recipe_id_latest }} -r cura-private -c