installers.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. name: All installers
  2. run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. cura_conan_version:
  7. description: 'Cura Conan Version'
  8. default: 'cura/latest@ultimaker/testing'
  9. required: true
  10. type: string
  11. conan_args:
  12. description: 'Conan args: eq.: --require-override'
  13. default: ''
  14. required: false
  15. type: string
  16. enterprise:
  17. description: 'Build Cura as an Enterprise edition'
  18. default: false
  19. required: true
  20. type: boolean
  21. staging:
  22. description: 'Use staging API'
  23. default: false
  24. required: true
  25. type: boolean
  26. nightly:
  27. description: 'Upload to nightly release'
  28. default: false
  29. required: true
  30. type: boolean
  31. schedule:
  32. # Daily at 5:15 CET
  33. - cron: '15 3 * * *'
  34. env:
  35. CURA_CONAN_VERSION: ${{ inputs.cura_conan_version || 'cura/latest@ultimaker/testing' }}
  36. CONAN_ARGS: ${{ inputs.conan_args || '' }}
  37. ENTERPRISE: ${{ inputs.enterprise || false }}
  38. STAGING: ${{ inputs.staging || false }}
  39. jobs:
  40. default-values:
  41. runs-on: ubuntu-latest
  42. outputs:
  43. cura_conan_version: ${{ steps.default.outputs.cura_conan_version }}
  44. steps:
  45. - name: Output default values
  46. id: default
  47. shell: python
  48. run: |
  49. import os
  50. cura_conan_version = "cura/latest@ultimaker/testing" if "${{ github.event.inputs.cura_conan_version }}" == "" else "${{ github.event.inputs.cura_conan_version }}"
  51. output_env = os.environ["GITHUB_OUTPUT"]
  52. content = ""
  53. if os.path.exists(output_env):
  54. with open(output_env, "r") as f:
  55. content = f.read()
  56. with open(output_env, "w") as f:
  57. f.write(content)
  58. f.writelines(f"cura_conan_version={cura_conan_version}\n")
  59. windows-installer:
  60. uses: ./.github/workflows/windows.yml
  61. needs: [ default-values ]
  62. with:
  63. cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
  64. conan_args: ${{ github.event.inputs.conan_args }}
  65. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  66. staging: ${{ github.event.inputs.staging == 'true' }}
  67. architecture: X64
  68. operating_system: windows-2022
  69. secrets: inherit
  70. linux-installer:
  71. uses: ./.github/workflows/linux.yml
  72. needs: [ default-values ]
  73. with:
  74. cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
  75. conan_args: ${{ github.event.inputs.conan_args }}
  76. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  77. staging: ${{ github.event.inputs.staging == 'true' }}
  78. architecture: X64
  79. operating_system: ubuntu-22.04
  80. secrets: inherit
  81. macos-installer:
  82. uses: ./.github/workflows/macos.yml
  83. needs: [ default-values ]
  84. with:
  85. cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
  86. conan_args: ${{ github.event.inputs.conan_args }}
  87. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  88. staging: ${{ github.event.inputs.staging == 'true' }}
  89. architecture: X64
  90. operating_system: self-hosted-X64
  91. secrets: inherit
  92. macos-arm-installer:
  93. uses: ./.github/workflows/macos.yml
  94. needs: [ default-values ]
  95. with:
  96. cura_conan_version: ${{ needs.default-values.outputs.cura_conan_version }}
  97. conan_args: ${{ github.event.inputs.conan_args }}
  98. enterprise: ${{ github.event.inputs.enterprise == 'true' }}
  99. staging: ${{ github.event.inputs.staging == 'true' }}
  100. architecture: ARM64
  101. operating_system: self-hosted-ARM64
  102. secrets: inherit
  103. # Run and update nightly release when the nightly input is set to true or if the schedule is triggered
  104. update-nightly-release:
  105. if: ${{ inputs.nightly || github.event_name == 'schedule' }}
  106. runs-on: ubuntu-latest
  107. needs: [ windows-installer, linux-installer, macos-installer, macos-arm-installer ]
  108. steps:
  109. - name: Checkout
  110. uses: actions/checkout@v3
  111. # It's not necessary to download all three, but it does make sure we have at least one if an OS is skipped.
  112. - name: Download the run info
  113. uses: actions/download-artifact@v2
  114. with:
  115. name: linux-run-info
  116. - name: Set the run info as environment variables
  117. run: |
  118. . run_info.sh
  119. - name: Output the name file name and extension
  120. id: filename
  121. shell: python
  122. run: |
  123. import os
  124. import datetime
  125. enterprise = "-Enterprise" if "${{ github.event.inputs.enterprise }}" == "true" else ""
  126. linux = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-linux-X64"
  127. mac_x64_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  128. mac_x64_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-X64"
  129. mac_arm_dmg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  130. mac_arm_pkg = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-macos-ARM64"
  131. win_msi = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  132. win_exe = installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-win64-X64"
  133. nightly_name = "UltiMaker-Cura-" + os.getenv('CURA_VERSION_FULL').split("+")[0]
  134. nightly_creation_time = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
  135. output_env = os.environ["GITHUB_OUTPUT"]
  136. content = ""
  137. if os.path.exists(output_env):
  138. with open(output_env, "r") as f:
  139. content = f.read()
  140. with open(output_env, "w") as f:
  141. f.write(content)
  142. f.writelines(f"LINUX={linux}\n")
  143. f.writelines(f"MAC_X64_DMG={mac_x64_dmg}\n")
  144. f.writelines(f"MAC_X64_PKG={mac_x64_pkg}\n")
  145. f.writelines(f"MAC_ARM_DMG={mac_arm_dmg}\n")
  146. f.writelines(f"MAC_ARM_PKG={mac_arm_pkg}\n")
  147. f.writelines(f"WIN_MSI={win_msi}\n")
  148. f.writelines(f"WIN_EXE={win_exe}\n")
  149. f.writelines(f"NIGHTLY_NAME={nightly_name}\n")
  150. f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
  151. - name: Download linux installer jobs artifacts
  152. uses: actions/download-artifact@v2
  153. with:
  154. name: ${{ steps.filename.outputs.LINUX }}-AppImage
  155. path: installers
  156. - name: Download linux installer jobs asc artifacts
  157. uses: actions/download-artifact@v2
  158. with:
  159. name: ${{ steps.filename.outputs.LINUX }}-asc
  160. path: installers
  161. - name: Rename Linux installer to nightlies
  162. run: |
  163. mv installers/${{ steps.filename.outputs.LINUX }}.AppImage installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage
  164. mv installers/${{ steps.filename.outputs.LINUX }}.AppImage.asc installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage.asc
  165. - name: Update nightly release for Linux
  166. run: |
  167. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage --clobber
  168. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-linux-X64.AppImage.asc --clobber
  169. env:
  170. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  171. - name: Download win msi installer jobs artifacts
  172. uses: actions/download-artifact@v2
  173. with:
  174. name: ${{ steps.filename.outputs.WIN_MSI }}-msi
  175. path: installers
  176. - name: Download win exe installer jobs artifacts
  177. uses: actions/download-artifact@v2
  178. with:
  179. name: ${{ steps.filename.outputs.WIN_EXE }}-exe
  180. path: installers
  181. - name: Rename Windows installers to nightlies
  182. run: |
  183. mv installers/${{ steps.filename.outputs.WIN_MSI }}.msi installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi
  184. mv installers/${{ steps.filename.outputs.WIN_EXE }}.exe installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe
  185. - name: Update nightly release for Windows
  186. run: |
  187. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.msi --clobber
  188. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-win64-X64.exe --clobber
  189. env:
  190. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  191. - name: Download MacOS (X64) dmg installer jobs artifacts
  192. uses: actions/download-artifact@v2
  193. with:
  194. name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
  195. path: installers
  196. - name: Download MacOS (X64) pkg installer jobs artifacts
  197. uses: actions/download-artifact@v2
  198. with:
  199. name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
  200. path: installers
  201. - name: Rename MacOS (X64) installers to nightlies
  202. run: |
  203. mv installers/${{ steps.filename.outputs.MAC_X64_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg
  204. mv installers/${{ steps.filename.outputs.MAC_X64_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg
  205. - name: Update nightly release for MacOS (X64)
  206. run: |
  207. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.dmg --clobber
  208. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-X64.pkg --clobber
  209. env:
  210. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  211. - name: Download MacOS (ARM-64) dmg installer jobs artifacts
  212. uses: actions/download-artifact@v2
  213. with:
  214. name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
  215. path: installers
  216. - name: Download MacOS (ARM-64) pkg installer jobs artifacts
  217. uses: actions/download-artifact@v2
  218. with:
  219. name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
  220. path: installers
  221. - name: Rename MacOS (ARM-64) installers to nightlies
  222. run: |
  223. mv installers/${{ steps.filename.outputs.MAC_ARM_DMG }}.dmg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg
  224. mv installers/${{ steps.filename.outputs.MAC_ARM_PKG }}.pkg installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg
  225. - name: Update nightly release for MacOS (ARM-64)
  226. run: |
  227. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.dmg --clobber
  228. gh release upload nightly installers/${{ steps.filename.outputs.NIGHTLY_NAME }}-macos-ARM64.pkg --clobber
  229. env:
  230. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  231. - name: Update nightly release description (with date)
  232. if: always()
  233. run: |
  234. gh release edit nightly --title "${{ steps.filename.outputs.NIGHTLY_NAME }}" --notes "Nightly release created on: ${{ steps.filename.outputs.NIGHTLY_TIME }}"
  235. env:
  236. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}