mirror of
https://github.com/beetbox/beets.git
synced 2026-02-08 00:14:31 +01:00
release.py: Automate GitHub release creation
This commit is contained in:
parent
df07d83a6d
commit
1cbf992d4f
1 changed files with 38 additions and 0 deletions
|
|
@ -64,6 +64,9 @@ VERSION_LOCS = [
|
|||
),
|
||||
]
|
||||
|
||||
GITHUB_USER = 'beetbox'
|
||||
GITHUB_REPO = 'beets'
|
||||
|
||||
|
||||
def bump_version(version):
|
||||
"""Update the version number in setup.py, docs config, changelog,
|
||||
|
|
@ -312,5 +315,40 @@ def publish():
|
|||
subprocess.check_call(['twine', 'upload', path])
|
||||
|
||||
|
||||
@release.command()
|
||||
def ghrelease():
|
||||
"""Create a GitHub release using the `github-release` command-line
|
||||
tool.
|
||||
|
||||
Reads the changelog to upload from `changelog.md`. Uploads the
|
||||
tarball from the `dist` directory.
|
||||
"""
|
||||
version = get_version(1)
|
||||
tag = 'v' + version
|
||||
|
||||
# Load the changelog.
|
||||
with open(os.path.join(BASE, 'changelog.md')) as f:
|
||||
cl_md = f.read()
|
||||
|
||||
# Create the release.
|
||||
subprocess.check_call([
|
||||
'github-release', 'release',
|
||||
'-u', GITHUB_USER, '-r', GITHUB_REPO,
|
||||
'--tag', tag,
|
||||
'--name', '{} {}'.format(GITHUB_REPO, version),
|
||||
'--description', cl_md,
|
||||
])
|
||||
|
||||
# Attach the release tarball.
|
||||
tarball = os.path.join(BASE, 'dist', 'beets-{}.tar.gz'.format(version))
|
||||
subprocess.check_call([
|
||||
'github-release', 'upload',
|
||||
'-u', GITHUB_USER, '-r', GITHUB_REPO,
|
||||
'--tag', tag,
|
||||
'--name', os.path.basename(tarball),
|
||||
'--file', tarball,
|
||||
])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
release()
|
||||
|
|
|
|||
Loading…
Reference in a new issue