Skip to content
Snippets Groups Projects

The release script for bob that uses changelog as a guidance for release

Merged Pavel KORSHUNOV requested to merge releasescript into master
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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)
  • This will be outdated when bob.extension is updated. It would have been better to call this directly from bob.extension. I don't see why you couldn't use bob_new_version from the first place. It would have been better to make that script more flexible to use it directly from here.

  • Please register or sign in to reply
  • 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 of 1.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.

    • Please register or sign in to reply
    Please register or sign in to reply
    Loading