Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix snap releases still having version 0.2.0-pre1 instead of 0.2.0 #359

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions snap/get_version
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ strip_branch_tag_prefix() {
current_branch=$(git -C "${SNAPCRAFT_PART_SRC}" branch --show-current)

# Get the highest version tag which is prefixed with the current branch name.
tag=$(git tag --sort=-v:refname --merged="${current_branch}" | grep "^${current_branch}-" | head -1)
tag=$(git -c "versionsort.suffix=-pre" tag --sort=-v:refname --merged="${current_branch}" | grep "^${current_branch}-" | head -1)

# If there is no tag prefixed with the current branch name, use the most
# recent tag that does not have a non-numerical prefix (that's the case
# when we're building a snap for testing on a branch that's not
# "msentraid" or "google").
if [ -z "${tag}" ]; then
tag=$(git tag --sort=-v:refname --merged="${current_branch}" | grep -E '^[0-9]+' | head -1)
tag=$(git -c "versionsort.suffix=-pre" tag --sort=-v:refname --merged="${current_branch}" | grep -E '^[0-9]+' | head -1)
fi

version="${tag}"
Expand Down
Loading