Skip to content

Commit 2eebeec

Browse files
authored
v6.3.0
2 parents ae8a961 + 5b97eaf commit 2eebeec

2 files changed

Lines changed: 127 additions & 77 deletions

File tree

.github/workflows/PrepareJob.yml

Lines changed: 123 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ on:
6262
is_release_tag:
6363
description: ""
6464
value: ${{ jobs.Prepare.outputs.is_release_tag }}
65+
has_submodules:
66+
description: ""
67+
value: ${{ jobs.Prepare.outputs.has_submodules }}
6568
ref_kind:
6669
description: ""
6770
value: ${{ jobs.Prepare.outputs.ref_kind }}
71+
default_branch:
72+
description: ""
73+
value: ${{ jobs.Prepare.outputs.default_branch }}
6874
branch:
6975
description: ""
7076
value: ${{ jobs.Prepare.outputs.branch }}
@@ -86,28 +92,42 @@ on:
8692
# pr_mergedat:
8793
# description: ""
8894
# value: ${{ jobs.Prepare.outputs.pr_mergedat }}
95+
git_submodule_count:
96+
description: ""
97+
value: ${{ jobs.Prepare.outputs.git_submodule_count }}
98+
git_submodule_names:
99+
description: ""
100+
value: ${{ jobs.Prepare.outputs.git_submodule_names }}
101+
git_submodule_paths:
102+
description: ""
103+
value: ${{ jobs.Prepare.outputs.git_submodule_paths }}
89104

90105
jobs:
91106
Prepare:
92107
name: Extract Information
93108
runs-on: ubuntu-24.04
94109
outputs:
95-
on_default_branch: ${{ steps.Classify.outputs.on_default_branch }}
96-
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
97-
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
98-
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
99-
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
100-
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
101-
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
102-
is_nightly_tag: ${{ steps.Classify.outputs.is_nightly_tag }}
103-
is_release_tag: ${{ steps.Classify.outputs.is_release_tag }}
104-
ref_kind: ${{ steps.Classify.outputs.ref_kind }}
105-
branch: ${{ steps.Classify.outputs.branch }}
106-
tag: ${{ steps.Classify.outputs.tag }}
107-
version: ${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}
108-
# release_version: ${{ steps.FindPullRequest.outputs.release_version }}
109-
pr_title: ${{ steps.FindPullRequest.outputs.pr_title }}
110-
pr_number: ${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}
110+
on_default_branch: ${{ steps.Classify.outputs.on_default_branch }}
111+
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
112+
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
113+
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
114+
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
115+
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
116+
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
117+
is_nightly_tag: ${{ steps.Classify.outputs.is_nightly_tag }}
118+
is_release_tag: ${{ steps.Classify.outputs.is_release_tag }}
119+
has_submodules: ${{ steps.Classify.outputs.has_submodules }}
120+
ref_kind: ${{ steps.Classify.outputs.ref_kind }}
121+
default_branch: ${{ steps.Classify.outputs.default_branch }}
122+
branch: ${{ steps.Classify.outputs.branch }}
123+
tag: ${{ steps.Classify.outputs.tag }}
124+
version: ${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}
125+
# release_version: ${{ steps.FindPullRequest.outputs.release_version }}
126+
pr_title: ${{ steps.FindPullRequest.outputs.pr_title }}
127+
pr_number: ${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}
128+
git_submodule_count: ${{ steps.Classify.outputs.git_submodule_count }}
129+
git_submodule_names: ${{ steps.Classify.outputs.git_submodule_names }}
130+
git_submodule_paths: ${{ steps.Classify.outputs.git_submodule_paths }}
111131

112132
steps:
113133
- name: ⏬ Checkout repository
@@ -136,6 +156,8 @@ jobs:
136156
ANSI_LIGHT_BLUE=$'\x1b[94m'
137157
ANSI_NOCOLOR=$'\x1b[0m'
138158
159+
export GH_TOKEN=${{ github.token }}
160+
139161
ref="${{ github.ref }}"
140162
on_default_branch="false"
141163
on_main_branch="false"
@@ -146,84 +168,86 @@ jobs:
146168
is_release_commit="false"
147169
is_nightly_tag="false"
148170
is_release_tag="false"
171+
has_submodules="false"
149172
ref_kind="unknown"
150173
default_branch=""
151174
branch=""
152175
tag=""
153176
pr_number=""
154177
version=""
178+
git_submodule_count="0"
179+
git_submodule_names=""
180+
git_submodule_paths=""
155181
182+
printf "Classify Git reference '%s' " "${ref}"
156183
if [[ "${ref:0:11}" == "refs/heads/" ]]; then
184+
printf "${ANSI_LIGHT_GREEN}[BRANCH]\n"
157185
ref_kind="branch"
158186
branch="${ref:11}"
159187
160188
printf "Get default branch name ... "
161-
defaultBranch=$(gh repo view "${{ github.repository }}" --json defaultBranchRef --jq '.defaultBranchRef.name')
189+
defaultBranch=$(gh repo view "${{ github.repository }}" --json defaultBranchRef --jq '.defaultBranchRef.name' 2>&1)
162190
if [[ $? -eq 0 ]]; then
163-
printf " ${ANSI_LIGHT_GREEN} [OK]\n"
191+
printf "${ANSI_LIGHT_GREEN} [OK]\n"
192+
193+
default_branch="${defaultBranch}"
194+
printf " default_branch=%s\n" "${default_branch}"
164195
else
165-
printf " ${ANSI_LIGHT_RED} [FAILED]\n"
196+
printf "${ANSI_LIGHT_RED} [FAILED]\n"
197+
printf " %s\n" "${default_branch}"
166198
fi
167199
168-
printf "Commit check:\n"
200+
printf "Commit checks:\n"
201+
printf " Commit kind "
202+
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
203+
is_regular_commit="true"
204+
printf "${ANSI_LIGHT_YELLOW}[REGULAR]${ANSI_NOCOLOR}\n"
205+
else
206+
is_merge_commit="true"
207+
printf "${ANSI_LIGHT_GREEN}[MERGE]${ANSI_NOCOLOR}\n"
208+
fi
169209
210+
printf "Branch checks:\n"
170211
if [[ "${branch}" == "${defaultBranch}" ]]; then
171212
on_default_branch="true"
172-
173-
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
174-
is_regular_commit="true"
175-
printf " ${ANSI_LIGHT_YELLOW}regular "
176-
else
177-
is_merge_commit="true"
178-
printf " ${ANSI_LIGHT_GREEN}merge "
179-
fi
180-
printf "commit${ANSI_NOCOLOR} on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
213+
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
181214
fi
182215
183216
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
184217
on_main_branch="true"
185-
186-
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
187-
is_regular_commit="true"
188-
printf " ${ANSI_LIGHT_YELLOW}regular "
189-
else
190-
is_merge_commit="true"
191-
printf " ${ANSI_LIGHT_GREEN}merge "
192-
fi
193-
printf "commit${ANSI_NOCOLOR} on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
218+
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
194219
fi
195220
196221
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
197222
on_release_branch="true"
198-
199-
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
200-
is_regular_commit="true"
201-
printf " ${ANSI_LIGHT_YELLOW}regular "
202-
else
203-
is_release_commit="true"
204-
printf " ${ANSI_LIGHT_GREEN}release "
205-
fi
206-
printf "commit${ANSI_NOCOLOR} on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
223+
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
207224
fi
208225
209226
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
210227
on_dev_branch="true"
228+
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
229+
fi
211230
212-
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
213-
is_regular_commit="true"
214-
printf " ${ANSI_LIGHT_YELLOW}regular "
215-
else
216-
is_merge_commit="true"
217-
printf " ${ANSI_LIGHT_GREEN}merge "
231+
if [[ "${is_merge_commit}" == "true" ]]; then
232+
printf "Release checks:\n"
233+
printf " Release kind "
234+
if [[ "${on_main_branch}" == "true" ]]; then
235+
is_release_commit="true"
236+
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
237+
elif [[ "${on_version_branch}" == "true" ]]; then
238+
is_release_commit="true"
239+
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
240+
elif [[ "${on_release_branch}" == "true" ]]; then
241+
is_prerelease_commit="true"
242+
printf "${ANSI_LIGHT_YELLOW}[PRERELEASE]${ANSI_NOCOLOR}\n"
218243
fi
219-
printf "commit${ANSI_NOCOLOR} on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
220244
fi
221245
elif [[ "${ref:0:10}" == "refs/tags/" ]]; then
246+
printf "${ANSI_LIGHT_GREEN}[TAG]\n"
222247
ref_kind="tag"
223248
tag="${ref:10}"
224249
225-
printf "Tag check:\n"
226-
250+
printf "Tag checks:\n"
227251
printf " Check if tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
228252
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
229253
if [[ $? -eq 0 ]]; then
@@ -254,18 +278,30 @@ jobs:
254278
exit 1
255279
fi
256280
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
281+
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
257282
ref_kind="pullrequest"
258283
pr_number=${ref:11}
259284
pr_number=${pr_number%%/*}
260285
261-
printf "Pull Request check:\n"
286+
printf "Pull Request checks:\n"
262287
printf " Number: %s\n" "${pr_number}"
263288
else
289+
printf "${ANSI_LIGHT_RED}[UNKNOWN]\n"
264290
printf "${ANSI_LIGHT_RED}Unknown Git reference '%s'.${ANSI_NOCOLOR}\n" "${{ github.ref }}"
265291
printf "::error title=Classify Commit::Unknown Git reference '%s'.\n" "${{ github.ref }}"
266292
exit 1
267293
fi
268294
295+
# Submodules
296+
if [[ -f .gitsubmodules ]]; then
297+
has_submodules="true"
298+
git_modules_file=.gitmodules # $(git rev-parse --show-toplevel)/.gitmodules
299+
git_submodule_count="$(grep -Po '(?<=\[submodule \")(.*)(?=\"\])' "${git_modules_file}" | wc -l)"
300+
git_submodule_names="$(grep -Po '(?<=\[submodule \")(.*)(?=\"\])' "${git_modules_file}" | paste -sd ':' -)"
301+
git_submodule_paths="$(git config --file "${git_modules_file}" --null --name-only --get-regexp '\.path$' | xargs -0 -n1 git config --file "${git_modules_file}" --get | paste -sd ':' -)"
302+
fi
303+
304+
printf "\nWriting output variables ...\n"
269305
tee --append "${GITHUB_OUTPUT}" <<EOF
270306
on_default_branch=${on_default_branch}
271307
on_main_branch=${on_main_branch}
@@ -276,11 +312,16 @@ jobs:
276312
is_release_commit=${is_release_commit}
277313
is_nightly_tag=${is_nightly_tag}
278314
is_release_tag=${is_release_tag}
315+
has_submodules=${has_submodules}
279316
ref_kind=${ref_kind}
317+
default_branch=${default_branch}
280318
branch=${branch}
281319
tag=${tag}
282320
pr_number=${pr_number}
283321
version=${version}
322+
git_submodule_count=${git_submodule_count}
323+
git_submodule_names=${git_submodule_names}
324+
git_submodule_paths=${git_submodule_paths}
284325
EOF
285326
286327
# TODO: why not is_release_commit?
@@ -356,21 +397,28 @@ jobs:
356397
357398
- name: Debug
358399
run: |
359-
printf "on_main_branch: %s\n" "${{ steps.Classify.outputs.on_main_branch }}"
360-
printf "on_dev_branch: %s\n" "${{ steps.Classify.outputs.on_dev_branch }}"
361-
printf "on_release_branch: %s\n" "${{ steps.Classify.outputs.on_release_branch }}"
362-
printf "is_regular_commit: %s\n" "${{ steps.Classify.outputs.is_regular_commit }}"
363-
printf "is_merge_commit: %s\n" "${{ steps.Classify.outputs.is_merge_commit }}"
364-
printf "is_release_commit: %s\n" "${{ steps.Classify.outputs.is_release_commit }}"
365-
printf "is_nightly_tag: %s\n" "${{ steps.Classify.outputs.is_nightly_tag }}"
366-
printf "is_release_tag: %s\n" "${{ steps.Classify.outputs.is_release_tag }}"
367-
printf "ref_kind: %s\n" "${{ steps.Classify.outputs.ref_kind }}"
368-
printf "branch: %s\n" "${{ steps.Classify.outputs.branch }}"
369-
printf "tag: %s\n" "${{ steps.Classify.outputs.tag }}"
370-
printf "version: %s\n" "${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}"
371-
printf " from tag: %s\n" "${{ steps.Classify.outputs.version }}"
372-
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_version }}"
373-
printf "pr title: %s\n" "${{ steps.FindPullRequest.outputs.pr_title }}"
374-
printf "pr number: %s\n" "${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}"
375-
printf " from merge: %s\n" "${{ steps.Classify.outputs.pr_number }}"
376-
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_number }}"
400+
printf "on_default_branch: %s\n" "${{ steps.Classify.outputs.on_default_branch }}"
401+
printf "on_main_branch: %s\n" "${{ steps.Classify.outputs.on_main_branch }}"
402+
printf "on_release_branch: %s\n" "${{ steps.Classify.outputs.on_release_branch }}"
403+
printf "on_dev_branch: %s\n" "${{ steps.Classify.outputs.on_dev_branch }}"
404+
printf "is_regular_commit: %s\n" "${{ steps.Classify.outputs.is_regular_commit }}"
405+
printf "is_merge_commit: %s\n" "${{ steps.Classify.outputs.is_merge_commit }}"
406+
printf "is_release_commit: %s\n" "${{ steps.Classify.outputs.is_release_commit }}"
407+
printf "is_nightly_tag: %s\n" "${{ steps.Classify.outputs.is_nightly_tag }}"
408+
printf "is_release_tag: %s\n" "${{ steps.Classify.outputs.is_release_tag }}"
409+
printf "has_submodules: %s\n" "${{ steps.Classify.outputs.has_submodules }}"
410+
printf "ref_kind: %s\n" "${{ steps.Classify.outputs.ref_kind }}"
411+
printf "default_branch: %s\n" "${{ steps.Classify.outputs.default_branch }}"
412+
printf "branch: %s\n" "${{ steps.Classify.outputs.branch }}"
413+
printf "tag: %s\n" "${{ steps.Classify.outputs.tag }}"
414+
printf "version: %s\n" "${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}"
415+
printf " from tag: %s\n" "${{ steps.Classify.outputs.version }}"
416+
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_version }}"
417+
printf "pr title: %s\n" "${{ steps.FindPullRequest.outputs.pr_title }}"
418+
printf "pr number: %s\n" "${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}"
419+
printf " from merge: %s\n" "${{ steps.Classify.outputs.pr_number }}"
420+
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_number }}"
421+
printf "git_submodule_*:\n"
422+
printf " *_count_: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_count }}"
423+
printf " *_names: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_names }}"
424+
printf " *_paths: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_paths }}"

.github/workflows/PublishReleaseNotes.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,11 @@ jobs:
505505
if [[ $? -eq 0 ]]; then
506506
if [[ -z "${latestVersion}" ]]; then
507507
printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n"
508+
printf " latest=unknown\n"
508509
latestVersion="unknown"
509510
else
510511
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
512+
printf " latest=%s\n" "${latestVersion}"
511513
fi
512514
else
513515
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
@@ -529,7 +531,7 @@ jobs:
529531
530532
jsonInventory=$(jq -c -n \
531533
--arg structVersion "${STRUCT_VERSION}" \
532-
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
534+
--arg date "$(date +"%Y-%m-%dT%H:%M:%S%:z")" \
533535
--argjson jsonMeta "$(jq -c -n \
534536
--arg tag "${{ inputs.tag }}" \
535537
--arg version "${{ inputs.inventory-version }}" \
@@ -547,7 +549,7 @@ jobs:
547549
)" \
548550
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \
549551
)" \
550-
'{"version": $structVersion, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
552+
'{"version": "$structVersion", "timestamp": $date, "meta": $jsonMeta, "files": {}}'
551553
)
552554
fi
553555

0 commit comments

Comments
 (0)