release-process_release-candidate.yml 6.4 KB

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