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