Skip to content

Commit

Permalink
Pull request 2143: AG-29441 QA versions
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit c004644
Merge: f26ec44 24baee0
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Feb 9 13:09:44 2024 +0300

    Merge branch 'master' into AG-29441-qa-versions

commit f26ec44
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Feb 7 13:27:15 2024 +0300

    github: imp workflow doc

commit 825a00c
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Feb 6 18:53:32 2024 +0300

    scripts: imp doc

commit ef62d96
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Feb 6 15:00:42 2024 +0300

    scrits: imp count

commit 2d02b23
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Feb 6 14:22:28 2024 +0300

    scripts: imp code, docs

commit 549bfb9
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Feb 5 18:54:55 2024 +0300

    scripts: imp dev version
  • Loading branch information
EugeneOne1 committed Feb 9, 2024
1 parent 24baee0 commit 7f83707
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 build-release build-docker'
# Set a custom version string, since the checkout@v2 action does not seem
# to know about the master branch, while the version script uses it to
# count the number of commits within the branch.
'run': 'make SIGN=0 VERBOSE=1 VERSION="v0.0.0-github" build-release build-docker'

'notify':
'needs':
Expand Down
14 changes: 11 additions & 3 deletions scripts/make/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ readonly channel
case "$channel"
in
('development')
# Use the dummy version for development builds.
version='v0.0.0'
# commit_number is the number of current commit within the branch.
commit_number="$( git rev-list --count master..HEAD )"
readonly commit_number

# The development builds are described with a combination of unset semantic
# version, the commit's number within the branch, and the commit hash, e.g.:
#
# v0.0.0-dev.5-a1b2c3d4
#
version="v0.0.0-dev.${commit_number}+$( git rev-parse --short HEAD )"
;;
('edge')
# last_minor_zero is the last new minor release.
Expand Down Expand Up @@ -128,7 +136,7 @@ in
esac

# Finally, make sure that we don't output invalid versions.
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-[ab]\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-(a|b|dev)\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
then
echo "generated an invalid version '$version'" 1>&2

Expand Down

0 comments on commit 7f83707

Please sign in to comment.