The release script for bob that uses changelog as a guidance for release
Merge request reports
Activity
added 1 commit
- 92058658 - can tag and realease packages based on changelog
Hi guys, I have more less finished the script that automatically releases packages by following the provided changelog file. This script does the following for each package in the changelog:
- For each tag, finds it and updates its description
- For the last tag in changelog (minor, major, patch), it follows the procedure similar to the one in
new_version.py
ofbob.extension
:
- increases the version of the last tag in GitLab accordingly
- updates readme and version.txt of the package, commits them
- tags with a new version
- updates readme and version.txt again and commits with [skip ci]
- If the last tag is none, it means, the last non-skip-ci pipeline will be re-started again.
- It waits for the pipeline to finish before continuing to the next package in changelog
One thing is left is to add an option to restart release process from any package in the changelog. This is useful in case of errors in the middle of the release.
And there is a little difference in the way the package is released compared to
new_version.py
script. Commit with new version and a new tag are pushed to GitLab separately, so the pipeline is triggered twice. It seems this behavior cannot be avoided if we use GitLab API. One thing I can do is to cancel the pipeline triggered by commit but keep the pipeline of the tag. But if you have other suggestions, please let me know.So, @andre.anjos, @tiago.pereira, @amohammadi, what do you think about this script? I want to finish it on Thursday and release bob before Easter. :)
added 1 commit
- 6fe3e6f1 - added options to resume release, single package release, and dry-run
added 1 commit
- 55b9004e - cancel duplicated pipelines, wait before quering pipelines
added 1 commit
- 07288fad - allow project with empty tags, fixed changelog
@andre.anjos @tiago.pereira @amohammadi @bob
All packages in https://gitlab.idiap.ch/bob/bob.nightlies/blob/master/order.txt have been released and their tags were updated according to the changelog.
So, we can safely release Bob itself.
Happy Easter!
mentioned in commit d2673067
- release/release_bob.py 0 → 100755
57 new_readme = [] 58 for line in readme.splitlines(): 59 if BRANCH_RE.search(line) is not None: 60 if "gitlab" in line: # gitlab links 61 replacement = "/v%s" % version if version is not None else "/master" 62 line = BRANCH_RE.sub(replacement, line) 63 if "software/bob" in line: # our doc server 64 if 'master' not in line: # don't replace 'latest' pointer 65 replacement = "/v%s" % version if version is not None \ 66 else "/stable" 67 line = BRANCH_RE.sub(replacement, line) 68 if DOC_IMAGE.search(line) is not None: 69 replacement = '-v%s-' % version if version is not None else '-stable-' 70 line = DOC_IMAGE.sub(replacement, line) 71 new_readme.append(line) 72 return '\n'.join(new_readme) - release/release_bob.py 0 → 100755
75 def get_parsed_tag(gitpkg, tag): 76 """ 77 An older tag is formatted as 'v2.1.3 (Sep 22, 2017 10:37)', from which we need only v2.1.3 78 The latest tag is either patch, minor, major, or none 79 """ 80 m = re.search(r"(v\d.\d.\d)", tag) 81 if m: 82 return m.group(0) 83 # tag = Version(tag) 84 85 # if we bump the version, we need to find the latest released version for this package 86 if 'patch' == tag or 'minor' == tag or 'major' == tag: 87 latest_tag = gitpkg.tags.list(per_page=1, page=1) 88 # if there were no tags yet, assume the first version 89 if not latest_tag: 90 return 'v1.0.0' The default tag for packages without any tag should be
0.0.1
instead of1.0.0
. Making a package version 1 means that the author will follow strict semantic versioning from now and the package is stable: https://semver.org/ However, this is not true at all for not yet released packages.