conan-recipe-export.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. recipe_id_pr:
  12. required: false
  13. type: string
  14. runs_on:
  15. required: true
  16. type: string
  17. python_version:
  18. required: true
  19. type: string
  20. conan_config_branch:
  21. required: false
  22. type: string
  23. conan_logging_level:
  24. required: false
  25. type: string
  26. conan_export_binaries:
  27. required: false
  28. type: boolean
  29. env:
  30. CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
  31. CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
  32. CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
  33. CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
  34. CONAN_LOG_RUN_TO_OUTPUT: 1
  35. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  36. CONAN_NON_INTERACTIVE: 1
  37. jobs:
  38. package-export:
  39. runs-on: ${{ inputs.runs_on }}
  40. steps:
  41. - name: Checkout project
  42. uses: actions/checkout@v3
  43. - name: Setup Python and pip
  44. uses: actions/setup-python@v4
  45. with:
  46. python-version: ${{ inputs.python_version }}
  47. cache: 'pip'
  48. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  49. - name: Install Python requirements and Create default Conan profile
  50. run: |
  51. pip install -r .github/workflows/requirements-conan-package.txt
  52. conan profile new default --detect
  53. - name: Cache Conan local repository packages
  54. uses: actions/cache@v3
  55. with:
  56. path: $HOME/.conan/data
  57. key: ${{ runner.os }}-conan
  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: Export the Package (binaries)
  65. if: ${{ inputs.conan_export_binaries == 'true' }}
  66. run: conan export-pkg . ${{ inputs.recipe_id_full }}
  67. - name: Export the Package
  68. if: ${{ inputs.conan_export_binaries != 'true' && github.event_name != 'pull_request' }}
  69. run: conan export . ${{ inputs.recipe_id_full }}
  70. - name: Create the latest alias
  71. if: ${{ inputs.recipe_id_latest != '' && github.event_name != 'pull_request' }}
  72. run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
  73. - name: Create the pull request alias
  74. if: ${{ inputs.recipe_id_pr != '' && github.event_name == 'pull_request' }}
  75. run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
  76. - name: Upload the Package(s)
  77. run: |
  78. # Only use --all (upload binaries) for the cura repository
  79. conan upload "*" -r cura --all -c
  80. conan upload "*" -r cura-ce -c