Skip to content

Commit

Permalink
Finish complete release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Oct 13, 2021
1 parent fcc728e commit 4f572c2
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions make/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def build_release(is_release=False, docker=False, build_version=None, onedir=Non


# TODO: fix this
def complete_release():
def download_and_complete_release():
for key, value in (
('CODESIGN_KEY_NAME', CODESIGN_KEY_NAME),
('NOTARIZE_PASSWORD_KEYCHAIN_NAME', NOTARIZE_PASSWORD_KEYCHAIN_NAME),
Expand All @@ -143,16 +143,25 @@ def complete_release():
f'No `{key}` environment variable provided!',
)

version = get_release_version()

for filename in (
f'Kanmail-mac-{version}.tar.gz',
f'Kanmail-nix64-{version}.tar.gz',
f'Kanmail-win-{version}.zip',
):
if not path.exists(path.join('pyu-data', 'new', filename)):
print_and_run(('aws', 's3', 'cp', f's3://builds.kanmail.io/{filename}', 'pyu-data/new'))

# Now use `codesign` to sign the package with a Developer ID
codesign_and_notarize(get_release_version())
codesign_and_notarize(version)

if not GITHUB_API_TOKEN:
raise click.ClickException(
'No `GITHUB_API_TOKEN` environment variable provided!',
)

release_version = get_release_version()
docker_image_tag = f'{DOCKER_NAME}:{release_version}'
docker_image_tag = f'{DOCKER_NAME}:{version}'

try:
# Check output to hide the JSON dump
Expand All @@ -167,17 +176,17 @@ def complete_release():
print_and_run(('docker', 'push', docker_latest_tag))

if not click.confirm((
f'Are you SURE v{release_version} is ready to release '
f'Are you SURE v{version} is ready to release '
'(commit changelog -> package -> sign -> upload)?'
)):
raise click.Abort('User is not sure!')

print_and_run(('pyupdater', 'pkg', '--process', '--sign'))
print_and_run(('pyupdater', 'upload', '--service', 's3'))

create_github_release(release_version)
create_github_release(version)

click.echo(f'--> Kanmail v{release_version} released!')
click.echo(f'--> Kanmail v{version} released!')

if click.confirm('Run cleanup?', default=True):
print_and_run(('python', '-m', 'make.clean'))
Expand All @@ -200,7 +209,7 @@ def build_or_release(complete_release, start_release, docker, version, onedir):

if complete_release:
click.echo('--> [3/3] completing relase')
complete_release()
download_and_complete_release()
return

if start_release:
Expand Down

0 comments on commit 4f572c2

Please sign in to comment.