release-process_release-candidate.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. name: Prepare Release Candidate
  2. run-name: Release Candidate for Cura ${{ inputs.cura_version }} by @${{ github.actor }}
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. cura_version:
  7. description: 'Cura version number, e.g. 5.7.0, 5.7.2 or 5.8.0-beta.2'
  8. required: true
  9. type: string
  10. publish_release_description:
  11. description: 'Create the GitHub release (if existing, the description will be overridden based on the changelog)'
  12. required: true
  13. type: boolean
  14. jobs:
  15. parse-version:
  16. name: Parse input version string
  17. runs-on: ubuntu-latest
  18. outputs:
  19. version_major: ${{ steps.version_parser.outputs.major }}
  20. version_minor: ${{ steps.version_parser.outputs.minor }}
  21. version_patch: ${{ steps.version_parser.outputs.patch }}
  22. branch_name: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}
  23. steps:
  24. - name: Parse version string
  25. id: version_parser
  26. uses: booxmedialtd/ws-action-parse-semver@v1.4.7
  27. with:
  28. input_string: ${{ inputs.cura_version }}
  29. freeze-packages-versions:
  30. name: Freeze packges versions
  31. uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml@main
  32. needs: [parse-version]
  33. with:
  34. cura_version: ${{ inputs.cura_version }}
  35. create_feature_branch: false
  36. secrets: inherit
  37. find-rc-tag:
  38. name: Find RC tag name
  39. runs-on: ubuntu-latest
  40. needs: [freeze-packages-versions]
  41. outputs:
  42. tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
  43. steps:
  44. - name: Checkout repo
  45. uses: actions/checkout@v4
  46. with:
  47. fetch-tags: true
  48. fetch-depth: 0
  49. - name: Find available tag name
  50. id: find-available-tag-name
  51. run: |
  52. VERSION=${{ inputs.cura_version }}
  53. RC_INDEX=0
  54. while
  55. RC_INDEX=$((RC_INDEX+1))
  56. TAG_NAME="$VERSION-RC$RC_INDEX"
  57. [[ $(git tag -l "$TAG_NAME") ]]
  58. do true; done
  59. echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
  60. create-tags:
  61. name: Create tags
  62. runs-on: ubuntu-latest
  63. needs: [parse-version, find-rc-tag]
  64. outputs:
  65. main_commit: ${{ steps.export-main-commit.outputs.main_commit }}
  66. strategy:
  67. matrix:
  68. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  69. steps:
  70. - name: Checkout repo
  71. uses: actions/checkout@v4
  72. with:
  73. repository: Ultimaker/${{ matrix.repository }}
  74. ref: ${{ needs.parse-version.outputs.branch_name }}
  75. token: ${{ secrets.CURA_AUTORELEASE_PAT }}
  76. - name: Create RC tag
  77. run: |
  78. git tag ${{ needs.find-rc-tag.outputs.tag_name }}
  79. git push origin tag ${{ needs.find-rc-tag.outputs.tag_name }}
  80. - name: Create or update release tag
  81. run: |
  82. git tag -f ${{ inputs.cura_version }}
  83. git push -f origin tag ${{ inputs.cura_version }}
  84. - name: Export Cura tagged commit
  85. id: export-main-commit
  86. if: ${{ matrix.repository == 'Cura' }}
  87. run: |
  88. echo "main_commit=`git rev-parse HEAD`" >> "$GITHUB_OUTPUT"
  89. create-dependencies-packages:
  90. name: Create conan packages for dependencies
  91. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@main
  92. needs: [parse-version, freeze-packages-versions]
  93. strategy:
  94. matrix:
  95. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  96. include:
  97. - conan_recipe_root: "."
  98. - repository: Cura
  99. conan_recipe_root: "resources"
  100. with:
  101. repository: ${{ matrix.repository }}
  102. ref_name: ${{ needs.parse-version.outputs.branch_name }}
  103. version: ${{ inputs.cura_version }}
  104. conan_release: true
  105. conan_user_channel: ultimaker/stable
  106. conan_internal: false
  107. conan_latest: true
  108. conan_recipe_root: ${{ matrix.conan_recipe_root }}
  109. secrets: inherit
  110. create-cura-package:
  111. name: Create conan package for Cura
  112. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@main
  113. needs: [parse-version, create-dependencies-packages]
  114. with:
  115. repository: Cura
  116. ref_name: ${{ needs.parse-version.outputs.branch_name }}
  117. version: ${{ inputs.cura_version }}
  118. conan_release: true
  119. conan_user_channel: ultimaker/stable
  120. conan_internal: false
  121. conan_latest: true
  122. secrets: inherit
  123. create-installers:
  124. name: Create installers
  125. uses: ./.github/workflows/installers.yml
  126. needs: [parse-version, create-cura-package]
  127. with:
  128. cura_conan_version: cura/${{ inputs.cura_version }}@/
  129. enterprise: false
  130. staging: false
  131. nightly: false
  132. secrets: inherit
  133. create-release-draft:
  134. name: Create the release draft
  135. runs-on: ubuntu-latest
  136. needs: [create-installers, parse-version, create-tags]
  137. steps:
  138. - name: Checkout Cura repo
  139. uses: actions/checkout@v4
  140. with:
  141. ref: ${{ needs.parse-version.outputs.branch_name }}
  142. - name: Extract changelog
  143. if: ${{ inputs.publish_release_description }}
  144. run: python ./scripts/extract_changelog.py --version ${{ needs.parse-version.outputs.version_major }}.${{ needs.parse-version.outputs.version_minor }}.${{ needs.parse-version.outputs.version_patch }} --changelog ./resources/texts/change_log.txt > formatted_changelog.txt
  145. - name: Create release
  146. uses: notpeelz/action-gh-create-release@v5.0.1
  147. if: ${{ inputs.publish_release_description }}
  148. with:
  149. target: ${{ needs.create-tags.outputs.main_commit }}
  150. tag: ${{ inputs.cura_version }}
  151. strategy: replace
  152. title: UltiMaker Cura ${{ inputs.cura_version }}
  153. draft: true
  154. body-source: file
  155. body: formatted_changelog.txt
  156. - name: Download artifacts
  157. uses: actions/download-artifact@v4.1.7
  158. with:
  159. path: artifacts
  160. merge-multiple: true
  161. - name: Upload artifacts
  162. working-directory: artifacts
  163. run: |
  164. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage --clobber
  165. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-linux-X64.AppImage.asc --clobber
  166. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.dmg --clobber
  167. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-ARM64.pkg --clobber
  168. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.dmg --clobber
  169. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-macos-X64.pkg --clobber
  170. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.exe --clobber
  171. gh release upload ${{ inputs.cura_version }} UltiMaker-Cura-${{ inputs.cura_version }}-win64-X64.msi --clobber
  172. env:
  173. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}