conan-package-create.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. name: Create and Upload Conan package
  2. on:
  3. workflow_call:
  4. inputs:
  5. recipe_id_full:
  6. required: true
  7. type: string
  8. runs_on:
  9. required: true
  10. type: string
  11. python_version:
  12. required: true
  13. type: string
  14. conan_config_branch:
  15. required: false
  16. type: string
  17. conan_logging_level:
  18. required: false
  19. type: string
  20. conan_clean_local_cache:
  21. required: false
  22. type: boolean
  23. default: false
  24. env:
  25. CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
  26. CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
  27. CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
  28. CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
  29. CONAN_LOG_RUN_TO_OUTPUT: 1
  30. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  31. CONAN_NON_INTERACTIVE: 1
  32. jobs:
  33. conan-package-create:
  34. runs-on: ${{ inputs.runs_on }}
  35. steps:
  36. - name: Checkout
  37. uses: actions/checkout@v3
  38. - name: Setup Python and pip
  39. uses: actions/setup-python@v4
  40. with:
  41. python-version: ${{ inputs.python_version }}
  42. cache: 'pip'
  43. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  44. - name: Install Python requirements and Create default Conan profile
  45. run: |
  46. pip install -r .github/workflows/requirements-conan-package.txt
  47. conan profile new default --detect
  48. - name: Use Conan download cache (Bash)
  49. if: ${{ runner.os != 'Windows' }}
  50. run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
  51. - name: Use Conan download cache (Powershell)
  52. if: ${{ runner.os == 'Windows' }}
  53. run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache"
  54. - name: Cache Conan local repository packages (Bash)
  55. uses: actions/cache@v3
  56. if: ${{ runner.os != 'Windows' }}
  57. with:
  58. path: |
  59. $HOME/.conan/data
  60. $HOME/.conan/conan_download_cache
  61. key: conan-${{ runner.os }}-${{ runner.arch }}
  62. - name: Cache Conan local repository packages (Powershell)
  63. uses: actions/cache@v3
  64. if: ${{ runner.os == 'Windows' }}
  65. with:
  66. path: |
  67. C:\Users\runneradmin\.conan\data
  68. C:\.conan
  69. C:\Users\runneradmin\.conan\conan_download_cache
  70. key: conan-${{ runner.os }}-${{ runner.arch }}
  71. - name: Install MacOS system requirements
  72. if: ${{ runner.os == 'Macos' }}
  73. run: brew install autoconf automake ninja
  74. - name: Install Linux system requirements
  75. if: ${{ runner.os == 'Linux' }}
  76. run: sudo apt install build-essential checkinstall zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev -y
  77. - name: Clean Conan local cache
  78. if: ${{ inputs.conan_clean_local_cache }}
  79. run: conan remove "*" -f
  80. - name: Get Conan configuration from branch
  81. if: ${{ inputs.conan_config_branch != '' }}
  82. run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
  83. - name: Get Conan configuration
  84. if: ${{ inputs.conan_config_branch == '' }}
  85. run: conan config install https://github.com/Ultimaker/conan-config.git
  86. - name: Create the Packages
  87. run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
  88. - name: Upload the Package(s)
  89. if: always()
  90. run: |
  91. conan upload "*" -r cura --all -c
  92. conan upload "*" -r cura-ce -c