1
+ name : bump version
2
+ # Upstream uses last portion of the version as a unique part to differentiate builds
3
+ # created from different commits. Last part (or VERSION_TWEAK) is basically a number
4
+ # of commits since the last tag (computed automatically by git).
5
+ # That works well for them, since they release from the same branch: e.g. 24.8,
6
+ # adding stuff to it and eventually pushing out the release.
7
+ #
8
+ # For Altinity we use different branches, and we don't put upstream tags to our repo.
9
+ # Hence we can't rely on this automatic behaviour from git.
10
+ #
11
+ # So in order to generate new version, whenever it makes sense, and to make it different from
12
+ # upstream's (Altinity versions have VERSION_TWEAK >= upsteam's versions VERSION_TWEAK)
13
+ # we increment existing VERSION_TWEAK by 1 each time.
14
+
15
+ env :
16
+ # version suffix to use in cmake/autogenerated_versions_new.txt
17
+ # due to current content of that file, anything different than 'altinitystable'
18
+ # will prepended to the VERSION_DESCRIBE-part.
19
+ # e.g. VERSION_TYPE: 'new' ==> VERSION_DESCRIBE='24.8.1.23.altinitystable-new'
20
+ VERSION_TYPE : altinitystable
21
+
22
+ on :
23
+ push :
24
+ branches :
25
+ # At the moment it seems wise to not execute on release branches:
26
+ # this workflow produces a new commit with a new version value,
27
+ # which might conflict with (already started by another workflow)
28
+ # build & release process, potentially cancelling it and
29
+ # re-triggering and re-doing of all of the builds and delaying the release.
30
+ - ' customizations/**'
31
+
32
+ jobs :
33
+ bump-version :
34
+ runs-on : [ubuntu-latest]
35
+ steps :
36
+ - name : checkout repo
37
+ uses : actions/checkout@v4
38
+
39
+ - name : Update cmake/autogenerated_versions.txt
40
+ run : |
41
+ awk 'match($0, /^(SET\(VERSION_TWEAK) ([0-9])+(.*\))/, m) { print(m[1] " " strtonum($2) + 1 "" m[3]) ; next } 1' \
42
+ cmake/autogenerated_versions.txt > cmake/autogenerated_versions_new.txt
43
+ mv cmake/autogenerated_versions_new.txt cmake/autogenerated_versions.txt
44
+ cat cmake/autogenerated_versions.txt
45
+ # update rest of the version info (mostly VERSION_DESCRIBE and VERSION_STRING)
46
+ python3 tests/ci/version_helper.py --update-cmake --version-type='altinitystable'
47
+
48
+ - name : push updated cmake/autogenerated_versions.txt
49
+ run : |
50
+ # export version info as multiple variables
51
+ source <(python3 tests/ci/version_helper.py --export --version-type='altinitystable')
52
+ git \
53
+
54
+ -c user.name=altinity-robot \
55
+ -c commit.gpgsign=false
56
+ git commit -a -m "Bumped version to $CLICKHOUSE_VERSION_DESCRIBE" cmake/autogenerated_versions.txt
57
+ git push
0 commit comments