From 68a747c3eff86b4630771f2cc61cdb762376213c Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Thu, 5 May 2022 15:40:00 -0700 Subject: [PATCH 1/3] build: change upload-to-s3 vars to upload-to-az --- .circleci/config.yml | 3 +-- .circleci/config/base.yml | 22 +++++++++++----------- appveyor.yml | 8 ++++---- script/release/ci-release-build.js | 6 +++--- script/release/uploaders/upload.py | 16 ++++++++-------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7556c5783095..4bf9bbcc64826 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,8 +14,7 @@ parameters: type: boolean default: false - # TODO (vertedinde): migrate this variable to upload-to-az - upload-to-s3: + upload-to-az: type: string default: '1' diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 3821ff4476cd9..a35be6d403bc5 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -5,7 +5,7 @@ parameters: type: boolean default: false - upload-to-s3: + upload-to-az: type: string default: '1' @@ -639,9 +639,9 @@ step-electron-publish: &step-electron-publish fi cd src/electron - if [ "$UPLOAD_TO_S3" == "1" ]; then - echo 'Uploading Electron release distribution to S3' - script/release/uploaders/upload.py --verbose --upload_to_s3 + if [ "$UPLOAD_TO_AZ" == "1" ]; then + echo 'Uploading Electron release distribution to Azure' + script/release/uploaders/upload.py --verbose --upload_to_az else echo 'Uploading Electron release distribution to Github releases' script/release/uploaders/upload.py --verbose @@ -1749,7 +1749,7 @@ jobs: environment: <<: *env-linux-2xlarge-release <<: *env-release-build - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running @@ -1850,7 +1850,7 @@ jobs: <<: *env-release-build <<: *env-32bit-release GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True' - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running @@ -1911,7 +1911,7 @@ jobs: <<: *env-arm64 <<: *env-release-build GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True' - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running @@ -1954,7 +1954,7 @@ jobs: environment: <<: *env-mac-large-release <<: *env-release-build - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running @@ -1974,7 +1974,7 @@ jobs: <<: *env-mac-large-release <<: *env-release-build <<: *env-apple-silicon - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running @@ -2037,7 +2037,7 @@ jobs: <<: *env-mac-large-release <<: *env-mas <<: *env-release-build - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> steps: - run: echo running - when: @@ -2056,7 +2056,7 @@ jobs: <<: *env-mac-large-release <<: *env-mas-apple-silicon <<: *env-release-build - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> <<: *env-ninja-status steps: - run: echo running diff --git a/appveyor.yml b/appveyor.yml index 018523baa1e25..0b2b641e48532 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ # - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}. # Is used in some publishing scripts, but does NOT affect the Electron binary. # Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value. -# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket. +# - "UPLOAD_TO_AZ" Set it to '1' upload a release to the Azure bucket. # Otherwise the release will be uploaded to the Github Releases. # (The value is only checked if "ELECTRON_RELEASE" is defined.) # @@ -231,9 +231,9 @@ deploy_script: - cd electron - ps: >- if (Test-Path Env:\ELECTRON_RELEASE) { - if (Test-Path Env:\UPLOAD_TO_S3) { - Write-Output "Uploading Electron release distribution to s3" - & python script\release\uploaders\upload.py --verbose --upload_to_s3 + if (Test-Path Env:\UPLOAD_TO_AZ) { + Write-Output "Uploading Electron release distribution to azure" + & python script\release\uploaders\upload.py --verbose --upload_to_az } else { Write-Output "Uploading Electron release distribution to github releases" & python script\release\uploaders\upload.py --verbose diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index 57f1e0b5d98c6..23dd9ace8ec7c 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -62,9 +62,9 @@ async function circleCIcall (targetBranch, workflowName, options) { parameters: {} }; if (options.ghRelease) { - buildRequest.parameters['upload-to-s3'] = '0'; + buildRequest.parameters['upload-to-az'] = '0'; } else { - buildRequest.parameters['upload-to-s3'] = '1'; + buildRequest.parameters['upload-to-az'] = '1'; } buildRequest.parameters[`run-${workflowName}`] = true; if (options.arch) { @@ -205,7 +205,7 @@ async function callAppVeyor (targetBranch, job, options) { }; if (!options.ghRelease) { - environmentVariables.UPLOAD_TO_S3 = 1; + environmentVariables.UPLOAD_TO_AZ = 1; } const requestOpts = { diff --git a/script/release/uploaders/upload.py b/script/release/uploaders/upload.py index d49e0a5f936bb..a281f0fc80979 100755 --- a/script/release/uploaders/upload.py +++ b/script/release/uploaders/upload.py @@ -45,7 +45,7 @@ def main(): args = parse_args() if args.verbose: enable_verbose_mode() - if args.upload_to_s3: + if args.upload_to_az: utcnow = datetime.datetime.utcnow() args.upload_timestamp = utcnow.strftime('%Y%m%d') @@ -62,7 +62,7 @@ def main(): if not release['draft']: tag_exists = True - if not args.upload_to_s3: + if not args.upload_to_az: assert release['exists'], \ 'Release does not exist; cannot upload to GitHub!' assert tag_exists == args.overwrite, \ @@ -140,7 +140,7 @@ def main(): OUT_DIR, 'hunspell_dictionaries.zip') upload_electron(release, hunspell_dictionaries_zip, args) - if not tag_exists and not args.upload_to_s3: + if not tag_exists and not args.upload_to_az: # Upload symbols to symbol server. run_python_upload_script('upload-symbols.py') if PLATFORM == 'win32': @@ -165,9 +165,9 @@ def parse_args(): parser.add_argument('-p', '--publish-release', help='Publish the release', action='store_true') - parser.add_argument('-s', '--upload_to_s3', - help='Upload assets to s3 bucket', - dest='upload_to_s3', + parser.add_argument('-s', '--upload_to_az', + help='Upload assets to azure bucket', + dest='upload_to_az', action='store_true', default=False, required=False) @@ -332,9 +332,9 @@ def upload_electron(release, file_path, args): except NonZipFileError: pass - # if upload_to_s3 is set, skip github upload. + # if upload_to_az is set, skip github upload. # todo (vertedinde): migrate this variable to upload_to_az - if args.upload_to_s3: + if args.upload_to_az: key_prefix = 'release-builds/{0}_{1}'.format(args.version, args.upload_timestamp) store_artifact(os.path.dirname(file_path), key_prefix, [file_path]) From 3bda2bf505b7ebc707ff0a39a5077696c1502946 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Thu, 5 May 2022 16:33:29 -0700 Subject: [PATCH 2/3] build: change upload-to-az to upload-to-storage --- .circleci/config.yml | 2 +- .circleci/config/base.yml | 20 ++++++++++---------- appveyor.yml | 6 +++--- script/release/ci-release-build.js | 6 +++--- script/release/uploaders/upload.py | 16 ++++++++-------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4bf9bbcc64826..372018b9e2532 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ parameters: type: boolean default: false - upload-to-az: + upload-to-storage: type: string default: '1' diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index a35be6d403bc5..2409cbae74487 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -5,7 +5,7 @@ parameters: type: boolean default: false - upload-to-az: + upload-to-storage: type: string default: '1' @@ -639,9 +639,9 @@ step-electron-publish: &step-electron-publish fi cd src/electron - if [ "$UPLOAD_TO_AZ" == "1" ]; then + if [ "$UPLOAD_TO_STORAGE" == "1" ]; then echo 'Uploading Electron release distribution to Azure' - script/release/uploaders/upload.py --verbose --upload_to_az + script/release/uploaders/upload.py --verbose --UPLOAD_TO_STORAGE else echo 'Uploading Electron release distribution to Github releases' script/release/uploaders/upload.py --verbose @@ -1749,7 +1749,7 @@ jobs: environment: <<: *env-linux-2xlarge-release <<: *env-release-build - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running @@ -1850,7 +1850,7 @@ jobs: <<: *env-release-build <<: *env-32bit-release GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True' - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running @@ -1911,7 +1911,7 @@ jobs: <<: *env-arm64 <<: *env-release-build GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True' - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running @@ -1954,7 +1954,7 @@ jobs: environment: <<: *env-mac-large-release <<: *env-release-build - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running @@ -1974,7 +1974,7 @@ jobs: <<: *env-mac-large-release <<: *env-release-build <<: *env-apple-silicon - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running @@ -2037,7 +2037,7 @@ jobs: <<: *env-mac-large-release <<: *env-mas <<: *env-release-build - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> steps: - run: echo running - when: @@ -2056,7 +2056,7 @@ jobs: <<: *env-mac-large-release <<: *env-mas-apple-silicon <<: *env-release-build - UPLOAD_TO_AZ: << pipeline.parameters.upload-to-az >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running diff --git a/appveyor.yml b/appveyor.yml index 0b2b641e48532..5366023e30949 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ # - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}. # Is used in some publishing scripts, but does NOT affect the Electron binary. # Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value. -# - "UPLOAD_TO_AZ" Set it to '1' upload a release to the Azure bucket. +# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket. # Otherwise the release will be uploaded to the Github Releases. # (The value is only checked if "ELECTRON_RELEASE" is defined.) # @@ -231,9 +231,9 @@ deploy_script: - cd electron - ps: >- if (Test-Path Env:\ELECTRON_RELEASE) { - if (Test-Path Env:\UPLOAD_TO_AZ) { + if (Test-Path Env:\UPLOAD_TO_STORAGE) { Write-Output "Uploading Electron release distribution to azure" - & python script\release\uploaders\upload.py --verbose --upload_to_az + & python script\release\uploaders\upload.py --verbose --upload_to_storage } else { Write-Output "Uploading Electron release distribution to github releases" & python script\release\uploaders\upload.py --verbose diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index 23dd9ace8ec7c..ce9deae23bfd6 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -62,9 +62,9 @@ async function circleCIcall (targetBranch, workflowName, options) { parameters: {} }; if (options.ghRelease) { - buildRequest.parameters['upload-to-az'] = '0'; + buildRequest.parameters['upload-to-storage'] = '0'; } else { - buildRequest.parameters['upload-to-az'] = '1'; + buildRequest.parameters['upload-to-storage'] = '1'; } buildRequest.parameters[`run-${workflowName}`] = true; if (options.arch) { @@ -205,7 +205,7 @@ async function callAppVeyor (targetBranch, job, options) { }; if (!options.ghRelease) { - environmentVariables.UPLOAD_TO_AZ = 1; + environmentVariables.UPLOAD_TO_STORAGE = 1; } const requestOpts = { diff --git a/script/release/uploaders/upload.py b/script/release/uploaders/upload.py index a281f0fc80979..1519e60e4442c 100755 --- a/script/release/uploaders/upload.py +++ b/script/release/uploaders/upload.py @@ -45,7 +45,7 @@ def main(): args = parse_args() if args.verbose: enable_verbose_mode() - if args.upload_to_az: + if args.upload_to_storage: utcnow = datetime.datetime.utcnow() args.upload_timestamp = utcnow.strftime('%Y%m%d') @@ -62,7 +62,7 @@ def main(): if not release['draft']: tag_exists = True - if not args.upload_to_az: + if not args.upload_to_storage: assert release['exists'], \ 'Release does not exist; cannot upload to GitHub!' assert tag_exists == args.overwrite, \ @@ -140,7 +140,7 @@ def main(): OUT_DIR, 'hunspell_dictionaries.zip') upload_electron(release, hunspell_dictionaries_zip, args) - if not tag_exists and not args.upload_to_az: + if not tag_exists and not args.upload_to_storage: # Upload symbols to symbol server. run_python_upload_script('upload-symbols.py') if PLATFORM == 'win32': @@ -165,9 +165,9 @@ def parse_args(): parser.add_argument('-p', '--publish-release', help='Publish the release', action='store_true') - parser.add_argument('-s', '--upload_to_az', + parser.add_argument('-s', '--upload_to_storage', help='Upload assets to azure bucket', - dest='upload_to_az', + dest='upload_to_storage', action='store_true', default=False, required=False) @@ -332,9 +332,9 @@ def upload_electron(release, file_path, args): except NonZipFileError: pass - # if upload_to_az is set, skip github upload. - # todo (vertedinde): migrate this variable to upload_to_az - if args.upload_to_az: + # if upload_to_storage is set, skip github upload. + # todo (vertedinde): migrate this variable to upload_to_storage + if args.upload_to_storage: key_prefix = 'release-builds/{0}_{1}'.format(args.version, args.upload_timestamp) store_artifact(os.path.dirname(file_path), key_prefix, [file_path]) From e0ebf148a0f78761ae0e5ca9f2fa8bb4fd9161d2 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Mon, 9 May 2022 12:53:15 -0700 Subject: [PATCH 3/3] build: change linux-ia32-publish var --- .circleci/config/base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 2409cbae74487..5777906e1acd1 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -1798,7 +1798,7 @@ jobs: <<: *env-ia32 <<: *env-release-build <<: *env-32bit-release - UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> + UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >> <<: *env-ninja-status steps: - run: echo running