conan-package.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ---
  2. name: conan-package
  3. # Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can
  4. # be used downstream.
  5. #
  6. # It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches
  7. on:
  8. workflow_dispatch:
  9. inputs:
  10. create_binaries_windows:
  11. required: true
  12. default: false
  13. description: 'create binaries Windows'
  14. create_binaries_linux:
  15. required: true
  16. default: false
  17. description: 'create binaries Linux'
  18. create_binaries_macos:
  19. required: true
  20. default: false
  21. description: 'create binaries Macos'
  22. push:
  23. paths:
  24. - 'plugins/**'
  25. - 'resources/**'
  26. - 'cura/**'
  27. - 'icons/**'
  28. - 'tests/**'
  29. - 'packaging/**'
  30. - '.github/workflows/conan-*.yml'
  31. - '.github/workflows/notify.yml'
  32. - '.github/workflows/requirements-conan-package.txt'
  33. - 'requirements*.txt'
  34. - 'conanfile.py'
  35. - 'conandata.yml'
  36. - 'GitVersion.yml'
  37. - '*.jinja'
  38. branches:
  39. - main
  40. - 'CURA-*'
  41. - '[1-9].[0-9]'
  42. - '[1-9].[0-9][0-9]'
  43. tags:
  44. - '[1-9].[0-9].[0-9]*'
  45. - '[1-9].[0-9].[0-9]'
  46. - '[1-9].[0-9][0-9].[0-9]*'
  47. env:
  48. CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
  49. CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
  50. CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
  51. CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
  52. CONAN_LOG_RUN_TO_OUTPUT: 1
  53. CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
  54. CONAN_NON_INTERACTIVE: 1
  55. permissions: {}
  56. jobs:
  57. conan-recipe-version:
  58. permissions:
  59. contents: read
  60. uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
  61. with:
  62. project_name: cura
  63. conan-package-create-linux:
  64. needs: [ conan-recipe-version ]
  65. runs-on: 'ubuntu-latest'
  66. steps:
  67. - name: Checkout
  68. uses: actions/checkout@v3
  69. - name: Setup Python and pip
  70. uses: actions/setup-python@v4
  71. with:
  72. python-version: '3.10.x'
  73. cache: 'pip'
  74. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  75. - name: Install Python requirements for runner
  76. run: pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
  77. # Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
  78. - name: Use Conan download cache (Bash)
  79. if: ${{ runner.os != 'Windows' }}
  80. run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
  81. - name: Cache Conan local repository packages (Bash)
  82. uses: actions/cache@v3
  83. with:
  84. path: |
  85. $HOME/.conan/data
  86. $HOME/.conan/conan_download_cache
  87. key: conan-ubuntu-${{ runner.arch }}-create-cache
  88. # NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
  89. # This is maybe because grub caches the disk it uses last time, which is recreated each time.
  90. - name: Install Linux system requirements
  91. if: ${{ runner.os == 'Linux' }}
  92. run: |
  93. sudo rm /var/cache/debconf/config.dat
  94. sudo dpkg --configure -a
  95. sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  96. sudo apt update
  97. sudo apt upgrade
  98. sudo apt install efibootmgr build-essential checkinstall libegl-dev 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 libxkbcommon-x11-dev pkg-config flex bison -y
  99. - name: Install GCC-12
  100. run: |
  101. sudo apt install g++-12 gcc-12 -y
  102. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
  103. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
  104. - name: Create the default Conan profile
  105. run: conan profile new default --detect
  106. - name: Get Conan configuration
  107. run: conan config install https://github.com/Ultimaker/conan-config.git
  108. - name: Create the Packages using lockfile
  109. run: conan create . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o ${{ needs.conan-recipe-version.outputs.project_name }}:devtools=True
  110. - name: Remove the latest alias
  111. if: ${{ needs.conan-recipe-version.outputs.recipe_id_latest != '' }}
  112. run: |
  113. conan remove ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura -f || true
  114. conan remove ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura-ce -f || true
  115. - name: Create the latest alias
  116. if: ${{ needs.conan-recipe-version.outputs.recipe_id_latest != '' && always() }}
  117. run: conan alias ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
  118. - name: Upload the Package(s)
  119. if: always()
  120. run: |
  121. conan upload "*" -r cura --all -c
  122. conan upload "*" -r cura-ce -c
  123. notify-create:
  124. if: ${{ always() && (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
  125. needs: [ conan-recipe-version, conan-package-create-linux ]
  126. uses: ultimaker/cura/.github/workflows/notify.yml@main
  127. with:
  128. success: ${{ contains(join(needs.*.result, ','), 'success') }}
  129. success_title: "New binaries created in ${{ github.repository }}"
  130. success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  131. failure_title: "Failed to create binaries in ${{ github.repository }}"
  132. failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  133. secrets: inherit