conan-package.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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: Cache Conan data
  70. id: cache-conan
  71. uses: actions/cache@v3
  72. with:
  73. path: ~/.conan
  74. key: ${{ runner.os }}-conan
  75. - name: Setup Python and pip
  76. uses: actions/setup-python@v4
  77. with:
  78. python-version: '3.11.x'
  79. cache: 'pip'
  80. cache-dependency-path: .github/workflows/requirements-conan-package.txt
  81. - name: Install Python requirements for runner
  82. run: pip install -r .github/workflows/requirements-conan-package.txt
  83. # NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
  84. # This is maybe because grub caches the disk it uses last time, which is recreated each time.
  85. - name: Install Linux system requirements
  86. if: ${{ runner.os == 'Linux' }}
  87. run: |
  88. sudo rm /var/cache/debconf/config.dat
  89. sudo dpkg --configure -a
  90. sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  91. sudo apt update
  92. sudo apt upgrade
  93. 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 g++-12 gcc-12 -y
  94. - name: Install GCC-13
  95. run: |
  96. sudo apt install g++-13 gcc-13 -y
  97. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
  98. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
  99. - name: Create the default Conan profile
  100. run: conan profile new default --detect --force
  101. - name: Get Conan configuration
  102. run: |
  103. conan config install https://github.com/Ultimaker/conan-config.git
  104. conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
  105. - name: Create the Packages
  106. run: conan create . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o ${{ needs.conan-recipe-version.outputs.project_name }}:devtools=True -c tools.build:skip_test=True
  107. - name: Create the latest alias
  108. if: always()
  109. run: conan alias ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
  110. - name: Upload the Package(s)
  111. if: always()
  112. run: |
  113. conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -r cura --all -c
  114. conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura -c
  115. notify-create:
  116. if: ${{ always() && (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
  117. needs: [ conan-recipe-version, conan-package-create-linux ]
  118. uses: ultimaker/cura/.github/workflows/notify.yml@main
  119. with:
  120. success: ${{ contains(join(needs.*.result, ','), 'success') }}
  121. success_title: "New binaries created in ${{ github.repository }}"
  122. success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  123. failure_title: "Failed to create binaries in ${{ github.repository }}"
  124. failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
  125. secrets: inherit