#!/usr/bin/env python3 """Script to create Github releases & generate release notes.""" import hashlib import json import logging import os import subprocess import sys import zipfile from third_party.python import colorlog, requests from third_party.python.absl import app, flags handler = colorlog.StreamHandler() handler.setFormatter(colorlog.ColoredFormatter('%(log_color)s%(levelname)s: %(message)s')) log = colorlog.getLogger(__name__) log.addHandler(handler) log.propagate = False # Needed to stop double logging?g flags.DEFINE_string('github_token', os.environ.get('GITHUB_TOKEN'), 'Github API token') flags.DEFINE_string('circleci_token', os.environ.get('CIRCLECI_TOKEN'), 'CircleCI API token') flags.DEFINE_string('signer', None, 'Release signer binary') flags.DEFINE_bool('dry_run', False, "Don't actually do the release, just print it.") flags.mark_flag_as_required('github_token') FLAGS = flags.FLAGS PRERELEASE_MESSAGE = """ This is a prerelease version of Please. Bugs and partially-finished features may abound.
#!/usr/bin/env python3 """Script to create Github releases & generate release notes.""" import hashlib import json import logging import os import subprocess import sys import zipfile from third_party.python import colorlog, requests from third_party.python.absl import app, flags logging.root.handlers[0].setFormatter(colorlog.ColoredFormatter('%(log_color)s%(levelname)s: %(message)s')) flags.DEFINE_string('github_token', os.environ.get('GITHUB_TOKEN'), 'Github API token') flags.DEFINE_string('circleci_token', os.environ.get('CIRCLECI_TOKEN'), 'CircleCI API token') flags.DEFINE_string('signer', None, 'Release signer binary') flags.DEFINE_bool('dry_run', False, "Don't actually do the release, just print it.") flags.mark_flag_as_required('github_token') FLAGS = flags.FLAGS PRERELEASE_MESSAGE = """ This is a prerelease version of Please. Bugs and partially-finished features may abound. Caveat usor! """