chore: update release scripts to support sudowoodo (#14170)

Backports the totality of our release script changes to support sudowoodo. Also backports changes that have been made to a few other release script files in master after 3-0-x was cut with the purpose of keeping them in sync.
This commit is contained in:
Shelley Vohr 2018-08-17 12:01:10 -07:00 committed by GitHub
parent 44b0245ac4
commit 2ecdf4a0eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 272 additions and 104 deletions

View file

@ -2,32 +2,38 @@
import os
import sys
import urllib2
from lib.config import PLATFORM, s3_config
from lib.util import electron_gyp, execute, s3put, scoped_cwd
from lib.config import s3_config
from lib.util import s3put, scoped_cwd, safe_mkdir
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'D')
PROJECT_NAME = electron_gyp()['project_name%']
PRODUCT_NAME = electron_gyp()['product_name%']
BASE_URL = 'https://electron-metadumper.herokuapp.com/?version=v'
version = sys.argv[1]
authToken = os.getenv('META_DUMPER_AUTH_HEADER')
def main():
if not authToken or authToken == "":
raise Exception("Please set META_DUMPER_AUTH_HEADER")
# Upload the index.json.
with scoped_cwd(SOURCE_ROOT):
if sys.platform == 'darwin':
electron = os.path.join(OUT_DIR, '{0}.app'.format(PRODUCT_NAME),
'Contents', 'MacOS', PRODUCT_NAME)
elif sys.platform == 'win32':
electron = os.path.join(OUT_DIR, '{0}.exe'.format(PROJECT_NAME))
else:
electron = os.path.join(OUT_DIR, PROJECT_NAME)
safe_mkdir(OUT_DIR)
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
execute([electron,
os.path.join('tools', 'dump-version-info.js'),
index_json])
request = urllib2.Request(
BASE_URL + version,
headers={"Authorization" : authToken}
)
new_content = urllib2.urlopen(
request
).read()
with open(index_json, "w") as f:
f.write(new_content)
bucket, access_key, secret_key = s3_config()
s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',