conan-recipe-export.yml 3.7 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_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 .github/workflows/requirements-conan-package.txt
  53. conan profile new default --detect
  54. - name: Cache Conan local repository packages
  55. uses: actions/cache@v3
  56. with:
  57. path: $HOME/.conan/data
  58. key: ${{ runner.os }}-conan-export-cache
  59. - name: Get Conan configuration from branch
  60. if: ${{ inputs.conan_config_branch != '' }}
  61. run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
  62. - name: Get Conan configuration
  63. if: ${{ inputs.conan_config_branch == '' }}
  64. run: conan config install https://github.com/Ultimaker/conan-config.git
  65. - name: Export the Package (binaries)
  66. if: ${{ inputs.conan_export_binaries }}
  67. run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
  68. - name: Export the Package
  69. if: ${{ !inputs.conan_export_binaries }}
  70. run: conan export . ${{ inputs.recipe_id_full }}
  71. - name: Remove the latest alias
  72. if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
  73. run: |
  74. conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
  75. conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
  76. - name: Create the latest alias
  77. if: ${{ inputs.recipe_id_latest != '' && always() }}
  78. run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
  79. - name: Upload the Package(s)
  80. if: always()
  81. run: conan upload "*" -r cura --all -c
  82. - name: Upload the Package(s) community
  83. if: ${{ always() && inputs.conan_upload_community == true }}
  84. run: conan upload "*" -r cura-ce -c