Skip to content

Commit 12affea

Browse files
Update release CI (#3294)
In the release CI and related scripts, when comparing and printing to the CI, use the most recent **ancestor** tag(s) for the release branch rather than the most recent one(s).
1 parent e885a07 commit 12affea

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

.github/scripts/fetch_and_compare_version.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ def fetch_version_from_code():
4242

4343

4444
def fetch_latest_git_tag():
45-
list_tag_cmd = (
46-
'git tag --list WAMR-*.*.* --sort=committerdate --format="%(refname:short)"'
47-
)
45+
"""
46+
Get the most recent tag from the HEAD,
47+
if it's main branch, it should be the latest release tag.
48+
if it's release/x.x.x branch, it should be the latest release tag of the branch.
49+
"""
50+
list_tag_cmd = "git describe --tags --abbrev=0 HEAD"
4851
p = subprocess.run(shlex.split(list_tag_cmd), capture_output=True, check=True)
4952

5053
all_tags = p.stdout.decode().strip()

.github/workflows/build_wamr_lldb.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ jobs:
8282
- name: install utils macos
8383
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
8484
run: |
85-
brew remove swig
86-
brew install [email protected] cmake ninja libedit
87-
brew link --overwrite [email protected]
85+
brew install swig cmake ninja libedit
8886
sudo rm -rf /Library/Developer/CommandLineTools
8987
9088
- name: install utils ubuntu

.github/workflows/create_tag.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,22 @@ jobs:
3232
- name: prepare
3333
id: preparation
3434
run: |
35-
# show latest 3 versions
36-
git tag --list WAMR-*.*.* --sort=committerdate --format="%(refname:short)" | tail -n 3
35+
# show latest 3 versions on the branch that create release
36+
# Set the initial commit to the head of the branch
37+
commit="HEAD"
38+
#
39+
# Loop to get the three most recent tags
40+
for i in {1..3}
41+
do
42+
# Get the most recent tag reachable from the current commit
43+
tag=$(git describe --tags --abbrev=0 $commit)
44+
45+
# Print the tag
46+
echo "$tag"
47+
48+
# Move to the commit before the found tag to find the next tag in the next iteration
49+
commit=$(git rev-list -n 1 $tag^)
50+
done
3751
# compare latest git tag and semantic version definition
3852
result=$(python3 ./.github/scripts/fetch_and_compare_version.py)
3953
echo "script result is ${result}"

0 commit comments

Comments
 (0)