From 18e6a5d1e6efd7b91b8bf7744b3d9ad8611e6bb9 Mon Sep 17 00:00:00 2001 From: Travis Thieman Date: Mon, 17 Aug 2015 17:19:19 -0400 Subject: [PATCH] Add release script to setup dir --- setup/release.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 setup/release.py diff --git a/setup/release.py b/setup/release.py new file mode 100644 index 00000000..57316d50 --- /dev/null +++ b/setup/release.py @@ -0,0 +1,24 @@ +import os +from github3 import login + +token = os.getenv('GITHUB_TOKEN') +gh = login(token=token) +repo = gh.repository('gamechanger', 'dusty') + +version = os.getenv('VERSION') +prerelease = os.getenv('PRERELEASE') == 'true' + +release_name = version +release = repo.create_release(version, name=release_name, prerelease=prerelease) + +for setup_file in ['com.gamechanger.dusty.plist', 'install.sh']: + with open(os.path.join('setup', setup_file), 'r') as f: + release.upload_asset(content_type='text/plain', + name=setup_file, + asset=f) + +for binary in ['dusty']: + with open(os.path.join('dist', binary), 'r') as f: + release.upload_asset(content_type='application/octet-stream', + name=binary, + asset=f)