diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index 426ca3c2b16a..aa6bc81d76d1 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -102,14 +102,20 @@ $ gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\") $GN_EXTRA_ Electron:** ```sh -$ gn gen out/Debug --args="import(\"//electron/build/args/release.gn\") $GN_EXTRA_ARGS" +$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\") $GN_EXTRA_ARGS" ``` **To build, run `ninja` with the `electron` target:** +Nota Bene: This will also take a while and probably heat up your lap. +For the debug configuration: ```sh $ ninja -C out/Debug electron -# This will also take a while and probably heat up your lap. +``` + +For the release configuration: +```sh +$ ninja -C out/Release electron ``` This will build all of what was previously 'libchromiumcontent' (i.e. the diff --git a/docs/development/releasing.md b/docs/development/releasing.md index 85a5fa0a9352..fcd90805dd48 100644 --- a/docs/development/releasing.md +++ b/docs/development/releasing.md @@ -243,19 +243,19 @@ Removing old .npmrc (default) Activating .npmrc "electron" ``` -The Electron account's credentials are kept by GitHub. -"Electron - NPM" for the URL "https://www.npmjs.com/login". +The Electron account's credentials are kept by GitHub in a password manager. +You'll also need to have access to an 2FA authenticator app with the appropriate OTP generator code to log in. ```sh $ npm login -Username: electron -Password: +Username: electron-nightly +Password: Email: (this IS public) electron@github.com ``` -Publish the release to npm. +Publish the release to npm. Before running this you'll need to have set `ELECTRON_NPM_OTP` as an environment variable using a code from the aforementioned 2FA authenticator app. ```sh $ npm whoami -electron +electron-nightly $ npm run publish-to-npm ``` @@ -320,17 +320,24 @@ Then manually create distributions for each platform and upload them: ```sh # Checkout the version to re-upload. -git checkout vTHE.RELEASE.VERSION +git checkout vX.Y.Z -# Do release build, specifying one target architecture. -./script/bootstrap.py --target_arch [arm|x64|ia32] -./script/build.py -c R -./script/create-dist.py +# Create release build +gn gen out/Release --args="import(\"//electron/build/args/release.gn\") $GN_EXTRA_ARGS" -# Explicitly allow overwritting a published release. +# To compile for specific arch, instead set +gn gen out/Release- --args='import(\"//electron/build/args/release.gn\") target_cpu = "[arm|x64|ia32]"' + +# Build by running ninja with the electron target +ninja -C out/Release electron +ninja -C out/Release electron:dist_zip + +# Explicitly allow overwriting a published release. ./script/upload.py --overwrite ``` +Allowable values for [target_cpu](https://gn.googlesource.com/gn/+/master/docs/reference.md#built_in-predefined-variables-target_cpu_the-desired-cpu-architecture-for-the-build-possible-values) and [target_os](https://gn.googlesource.com/gn/+/master/docs/reference.md#built_in-predefined-variables-target_os_the-desired-operating-system-for-the-build-possible-values). + After re-uploading all distributions, publish again to upload the checksum file: diff --git a/script/upload.py b/script/upload.py index 0bb9392e7dfb..41c1ca8b733f 100755 --- a/script/upload.py +++ b/script/upload.py @@ -39,9 +39,6 @@ def main(): utcnow = datetime.datetime.utcnow() args.upload_timestamp = utcnow.strftime('%Y%m%d') - if not dist_newer_than_head(): - run_python_script('create-dist.py') - build_version = get_electron_build_version() if not ELECTRON_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( @@ -135,20 +132,6 @@ def get_electron_build_version(): return subprocess.check_output([electron, '--version']).strip() -def dist_newer_than_head(): - with scoped_cwd(SOURCE_ROOT): - try: - head_time = subprocess.check_output(['git', 'log', '--pretty=format:%at', - '-n', '1']).strip() - dist_time = os.path.getmtime(os.path.join(DIST_DIR, DIST_NAME)) - except OSError as e: - if e.errno != errno.ENOENT: - raise - return False - - return dist_time > int(head_time) - - def upload_electron(release, file_path, args): filename = os.path.basename(file_path)