docs: def main():
      """Tags the current repository
  
      and commits changes to news files
      """
      # see:
      # https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi
      twine_repo = os.getenv('TWINE_REPOSITORY_URL') or os.getenv('TWINE_REPOSITORY')
      print('tagging and releasing to %s as %s' % (
          twine_repo,
          os.getenv('TWINE_USERNAME')
      ))
  
      if not twine_repo:
          raise Exception('cannot release to implicit pypi repository. explicitly set the repo/url.')
  
      version = subprocess.check_output(['pipenv', 'run', 'python', 'setup.py', '--version']).decode().strip()
      if 'dev' in version:
          raise Exception('cannot release unversioned project: %s' % version)
  
      print('Preparing environment')
      subprocess.check_call(['git', 'config', '--global', 'user.name', 'monty-bot'])
      subprocess.check_call(['git', 'config', '--global', 'user.email', 'monty-bot@arm.com'])
      url = subprocess.check_output(['git', 'remote', 'get-url', 'origin'])
      branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
      new_url = git_url_ssh_to_https(url.decode())
      subprocess.check_call(['git', 'remote', 'set-url', 'origin', new_url])
      branch_spec = 'origin/%s' % branch_name.decode('utf-8').strip()
      subprocess.check_call(['git', 'branch', '--set-upstream-to', branch_spec])
      print('Committing the changelog & version')
      subprocess.check_call(['git', 'add', 'src/auto_version/__version__.py'])
      subprocess.check_call(['git', 'add', 'CHANGELOG.md'])
      subprocess.check_call(['git', 'add', 'docs/news/*'])
      message = ':checkered_flag: :newspaper: Releasing version %s\n[skip ci]' % version
      subprocess.check_call(['git', 'commit', '-m', message])
      print('Tagging the project')
      subprocess.check_call(['git', 'tag', '-a', version, '-m', 'Release %s' % version])
      print('Pushing changes back to GitHub')
      subprocess.check_call(['git', 'push', '--follow-tags'])
      print('Marking this commit as latest')
      subprocess.check_call(['git', 'tag', '-f', 'latest'])
      subprocess.check_call(['git', 'push', '-f', '--tags'])
      print('Generating a release package')
      subprocess.check_call(
          ['pipenv', 'run', 'python', 'setup.py', 'clean', '--all', 'bdist_wheel', '--dist-dir', 'release-dist'])
      print('Uploading to PyPI')
      subprocess.check_call(['pipenv', 'run', 'python', '-m', 'twine', 'upload', 'release-dist/*'])
      print('Done.')