release-process_release-candidate.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. name: Prepare Release Candidate
  2. run-name: Release Candidate for Cura ${{ inputs.cura_version }} by @${{ github.actor }}
  3. on:
  4. workflow_call:
  5. inputs:
  6. cura_version:
  7. description: 'Cura version number, e.g. 5.7, 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. prepare-cura-repo:
  26. name: Update dependencies and find RC tag name
  27. runs-on: ubuntu-latest
  28. needs: [parse-version]
  29. outputs:
  30. tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
  31. steps:
  32. - name: Checkout repo
  33. uses: actions/checkout@v4
  34. with:
  35. ref: ${{ needs.parse-version.outputs.branch_name }}
  36. fetch-tags: true
  37. fetch-depth: 0
  38. - name: Update Cura dependencies
  39. run: |
  40. PACKAGE_VERSION=${{ inputs.cura_version }}
  41. sed -i "s/\"uranium\/.*/\"uranium\/$PACKAGE_VERSION\"/g" conandata.yml
  42. sed -i "s/\"cura_resources\/.*/\"cura_resources\/$PACKAGE_VERSION\"/g" conandata.yml
  43. sed -i "s/\"curaengine\/.*/\"curaengine\/$PACKAGE_VERSION\"/g" conandata.yml
  44. sed -i "s/\"cura_binary_data\/.*/\"cura_binary_data\/$PACKAGE_VERSION\"/g" conandata.yml
  45. sed -i "s/\"fdm_materials\/.*/\"fdm_materials\/$PACKAGE_VERSION\"/g" conandata.yml
  46. - name: Commit new dependencies versioning
  47. uses: stefanzweifel/git-auto-commit-action@v5.0.1
  48. with:
  49. commit_message: Set dependencies version ${{ inputs.cura_version }}
  50. file_pattern: conandata.yml
  51. - name: Find available tag name
  52. id: find-available-tag-name
  53. run: |
  54. VERSION=${{ inputs.cura_version }}
  55. RC_INDEX=0
  56. while
  57. RC_INDEX=$((RC_INDEX+1))
  58. TAG_NAME="$VERSION-RC$RC_INDEX"
  59. [[ $(git tag -l "$TAG_NAME") ]]
  60. do true; done
  61. echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
  62. create-tags:
  63. name: Create tags
  64. runs-on: ubuntu-latest
  65. needs: [parse-version, prepare-cura-repo]
  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 tag
  77. run: |
  78. git tag ${{ needs.prepare-cura-repo.outputs.tag_name }}
  79. git push origin tag ${{ needs.prepare-cura-repo.outputs.tag_name }}
  80. create-dependencies-packages:
  81. name: Create conan packages for dependencies
  82. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@CURA-10769_automate_release_action
  83. needs: [parse-version, prepare-cura-repo]
  84. strategy:
  85. matrix:
  86. repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
  87. include:
  88. - conan_recipe_root: "."
  89. - repository: Cura
  90. conan_recipe_root: "resources"
  91. with:
  92. repository: ${{ matrix.repository }}
  93. ref_name: ${{ needs.parse-version.outputs.branch_name }}
  94. version: ${{ inputs.cura_version }}
  95. conan_release: true
  96. conan_user_channel: ultimaker/stable
  97. conan_internal: false
  98. conan_latest: true
  99. conan_recipe_root: ${{ matrix.conan_recipe_root }}
  100. token: ${{ secrets.CURA_AUTORELEASE_PAT }}
  101. create-cura-package:
  102. name: Create conan package for Cura
  103. uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@CURA-10769_automate_release_action
  104. needs: [parse-version, create-dependencies-packages]
  105. with:
  106. repository: Cura
  107. ref_name: ${{ needs.parse-version.outputs.branch_name }}
  108. version: ${{ inputs.cura_version }}
  109. conan_release: true
  110. conan_user_channel: ultimaker/stable
  111. conan_internal: false
  112. conan_latest: true
  113. secrets: inherit
  114. create-installers:
  115. name: Create installers
  116. uses: ./.github/workflows/installers.yml
  117. needs: [parse-version, create-cura-package]
  118. with:
  119. cura_conan_version: cura/${{ inputs.cura_version }}@/
  120. enterprise: false
  121. staging: false
  122. nightly: false
  123. secrets: inherit
  124. create-release-draft:
  125. name: Create the release draft
  126. runs-on: ubuntu-latest
  127. needs: [create-installers, parse-version]
  128. steps:
  129. - name: Download artifacts
  130. uses: actions/download-artifact@v4.1.7
  131. with:
  132. path: artifacts
  133. merge-multiple: true
  134. - name: Checkout Cura repo
  135. uses: actions/checkout@v4
  136. with:
  137. ref: ${{ needs.parse-version.outputs.branch_name }}
  138. - name: Extract changelog
  139. 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
  140. - name: Get commit id for release
  141. id: get-commit-id
  142. uses: iawia002/get-tag-or-commit-id@v1.0.1
  143. with:
  144. length: 40
  145. - name: Create release
  146. uses: notpeelz/action-gh-create-release@v5.0.1
  147. with:
  148. target: ${{ steps.get-commit-id.outputs.id }}
  149. tag: ${{ inputs.cura_version }}
  150. strategy: replace
  151. title: UltiMaker Cura ${{ inputs.cura_version }}
  152. draft: true
  153. body-source: file
  154. body: formatted_changelog.txt
  155. files: artifacts/UltiMaker-Cura-*