From 7226e2c2702ac1ee015a5e18d8ab70773c49c34e Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Wed, 17 Aug 2022 10:54:55 -0400 Subject: [PATCH] Remove automated uploads (#2103) --- README.md | 6 ++++- gulpfile.js | 6 ++--- package.json | 3 +-- scripts/upload-panes.js | 56 ----------------------------------------- 4 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 scripts/upload-panes.js diff --git a/README.md b/README.md index 240b88d7c6..e11401d5a6 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,11 @@ Here are the steps to lock an inspector version: - Create a new branch (from `stable`) named after the Ember version range that will be supported by this branch. The min version in the range is the first element in the `emberVersionsSupported` array in `package.json`. The max version in the range is the first version that will *not* be supported. For example, a branch named `ember-0.0.0-2.7.0` means it supports Ember 0.0.0 -> 2.6.0, and a branch named `ember-2.7.0-3.4.0` means it supports Ember 2.7.0 -> Ember 3.3.2. - Update `package.json`'s `emberVersionsSupported`: add a second element that indicates the minimum Ember version the `master` branch *will not* support. - Commit the branch. -- Run `yarn lock-version`. This will build, compress, and upload this version to S3. +- Run `yarn lock-version`. This will build, and compress the panes. +- To upload the panes to GitHub: + - Create a folder locally with the naming convention `panes-x-x-x` + - Copy the 3 zip files (chrome.zip, firefox.zip, and bookmarklet.zip) into the folder you just created. + - Go to https://github.com/emberjs/ember-inspector/upload/panes and drag the folder in to upload it. - Checkout the `master` branch. - Update `package.json`'s `previousEmberVersionsSupported`: add the first Ember version supported by the recently locked snapshot (the first element in the `emberVersionsSupported` array). - Update `package.json`'s `emberVersionsSupported`: Take the last element from `previousEmberVersionsSupported` and set it as the first element in this array. Set an empty string as the second element to indicate there's currently no maximum Ember version supported yet. `emberVersionsSupported` array length should always be `2` indicating a [min, max] range. diff --git a/gulpfile.js b/gulpfile.js index 9009caab13..47eb28857e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,10 +20,10 @@ exports['compress:chrome'] = () => exports['compress:firefox'] = () => compress('dist/firefox', 'firefox/ember-inspector.zip'); exports['compress:chrome-pane'] = () => - compress(`dist/chrome/${versionedPane}`, 'chrome-pane.zip'); + compress(`dist/chrome/${versionedPane}`, 'chrome.zip'); exports['compress:firefox-pane'] = () => - compress(`dist/firefox/${versionedPane}`, 'firefox-pane.zip'); + compress(`dist/firefox/${versionedPane}`, 'firefox.zip'); exports['compress:bookmarklet-pane'] = () => - compress(`dist/bookmarklet/${versionedPane}`, 'bookmarklet-pane.zip'); + compress(`dist/bookmarklet/${versionedPane}`, 'bookmarklet.zip'); exports['clean-tmp'] = () => del('./tmp'); diff --git a/package.json b/package.json index 52da8139c8..50200141ea 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,12 @@ "lint:hbs": "ember-template-lint .", "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache", - "lock-version": "yarn build:production && yarn compress:panes && EMBER_ENV=production node scripts/upload-panes.js", + "lock-version": "yarn build:production && yarn compress:panes", "serve:bookmarklet": "ember serve --port 9191", "lint:js:fix": "eslint . --fix", "start": "ember serve", "test": "npm-run-all lint test:*", "test:ember": "COVERAGE=true ember test", - "upload:panes": "yarn build && yarn compress:panes && node scripts/upload-panes.js", "watch": "ember build --watch" }, "devDependencies": { diff --git a/scripts/upload-panes.js b/scripts/upload-panes.js deleted file mode 100644 index 3e2dc746c7..0000000000 --- a/scripts/upload-panes.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Uploads the current Ember Inspector pane - * to S3 to later be downloaded by future versions - * before publishing. - * - * Make sure you add the correct AWS credentials - * to `config/secrets.yml` before uploading. - */ -const AWS = require('aws-sdk'); -const packageJson = require('../package.json'); -const fs = require('fs'); - -// eslint-disable-next-line node/no-missing-require -const secrets = require('../config/secrets.json'); - -const version = packageJson.emberVersionsSupported[0]; - -function main() { - if (!packageJson.emberVersionsSupported[1]) { - console.log( - '\x1b[31m%s\x1b[0m', - '[FAILED] You need to set the right limit for the Ember versions supported (in package.json). Exiting...' - ); - process.exitCode = 1; - return; - } - - let config = { - accessKeyId: secrets.accessKeyId, - secretAccessKey: secrets.secretAccessKey, - region: 'eu-west-1', - }; - AWS.config.update(config); - - let env = process.env.EMBER_ENV || 'development'; - - let folderName = 'panes-' + version.replace(/\./g, '-'); - let s3 = new AWS.S3({ - params: { Bucket: 'ember-inspector-panes', ACL: 'public-read' }, - }); - - ['chrome', 'firefox', 'bookmarklet'].forEach(function (dist) { - let body = fs.createReadStream(`dist/${dist}-pane.zip`); - - s3.upload({ - Body: body, - Key: `${env}/${folderName}/${dist}.zip`, - }).send(function (err) { - if (err) { - throw err; - } - }); - }); -} - -main();