Skip to content

Commit

Permalink
Opera Beta Release Process scripts and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
taesup committed Dec 5, 2018
1 parent 2e7e38c commit ddedc79
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/beta-release/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@

### Create CRX file, ZIP file, and info.md files
- `npm run beta`
- `npm run beta:opera`

### Update info.md file in `./builds/info.md`
### Update info.md file in `./builds/info.md` and `./builds/info-opera.md`
- The changelog in this file should be updated so that no patch numbers are referenced
- Changelog should only include work since last beta release
- Update the Date of Release to when the Beta should go out to the public

### Create master zip file with all generated files
- `node script/chromeBetaMasterZip`
- `node script/operaBetaMasterZip`
- This should create a zip file with the ending `*-beta-release.zip` with all three files included.

### Notify Web team to update the client portal
- Send the master zip file to the web team through the #general-escalation channel
- Slack message template: `@web Here's the files for Chrome v{versionNumber} Extension Beta Release`
- Slack message template: `@web Here's the files for Opera v{versionNumber} Extension Beta Release`
- Include the master zip file in the above slack message
- clean up any files that aren't needed anymore

Expand All @@ -35,6 +38,12 @@
- ZIP File


## Opera Zip File Contents:
- INFO.md
- CRX File
- ZIP File


## Beta/Release Git Branching Model
- When all issues leading up to a beta release have been merged into `develop`, create a beta branch
- Naming scheme: `beta/v{versionNumber}`
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dev:opera": "node script/operaDev",
"qa": "node script/chromeQa && node script/operaQa",
"beta": "node script/chromeBeta && node script/chromeBetaZip && node script/chromeBetaInfo",
"beta:opera": "node script/operaBeta && node script/operaBetaZip && node script/operaBetaInfo",
"public": "node script/chromePublic && node script/operaPublic",
"public:opera": "node script/operaPublic",
"publish": "node script/chromePublish && echo \"no publish script for opera, must build manually via `npm run public:opera`\"",
Expand Down
75 changes: 75 additions & 0 deletions script/operaBetaInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const { print } = require('./util');

// Get Version
const versionFilePath = path.join(__dirname, '..', 'VERSION');
const versionFile = fs.readFileSync(versionFilePath, 'utf8');
const VERSION = versionFile.trim();

// Get Changelog
const clFilePath = path.join(__dirname, '..', 'CHANGELOG.md');
const clFile = fs.readFileSync(clFilePath, 'utf8');
const CHANGELOG = clFile.trim();

// Filepaths and Filenames
const filename = `private_internet_access-opera-v${VERSION}-beta`;
const crxFile = path.join(__dirname, '..', 'builds', `${filename}.nex`);
const zipFile = path.join(__dirname, '..', 'builds', `${filename}.zip`);
const infoFile = path.join(__dirname, '..', 'builds', 'info-opera.md');

const generateInfo = (checksums) => {
return `
Version:
${VERSION}
Release Date:
{DateOfRelease}
Git Commit Hash:
${checksums.commit}
SHA Checksum:
zip: ${checksums.zip}
crx: ${checksums.crx}
ChangeLog:
${CHANGELOG}
`.trim();
};

Promise.resolve()
// generate crx checksum
.then(() => {
const buildsDir = path.join(__dirname, '..', 'builds');
const shasumBuffer = execSync(`shasum -a 256 ${crxFile}`, { cwd: buildsDir });
const shasumString = shasumBuffer.toString();
const shasum = shasumString.split(' ')[0];
return { crx: shasum };
})
// generate zip checksum
.then((data) => {
const checksums = data;
const buildsDir = path.join(__dirname, '..', 'builds');
const shasumBuffer = execSync(`shasum -a 256 ${zipFile}`, { cwd: buildsDir });
const shasumString = shasumBuffer.toString();
const shasum = shasumString.split(' ')[0];
checksums.zip = shasum;
return checksums;
})
// get last git commit hash
.then((data) => {
const checksums = data;
const hashBuffer = execSync('git rev-parse HEAD');
const commitHash = hashBuffer.toString().trim();
checksums.commit = commitHash;
return checksums;
})
// generate info file
.then((checksums) => {
const infoTemplate = generateInfo(checksums);
return fs.writeFileSync(infoFile, infoTemplate);
})
// --- Errors ---
.catch((err) => { print(err.toString()); });
35 changes: 35 additions & 0 deletions script/operaBetaMasterZip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const { print } = require('./util');

// Get Version
const versionFilePath = path.join(__dirname, '..', 'VERSION');
const versionFile = fs.readFileSync(versionFilePath, 'utf8');
const VERSION = versionFile.trim();

// Filepaths and Filenames
const filename = `private_internet_access-opera-v${VERSION}-beta`;
const crxFile = `${filename}.nex`;
const zipFile = `${filename}.zip`;
const infoFile = 'info-opera.md';
const masterZip = path.join(__dirname, '..', 'builds', `${filename}-release.zip`);

Promise.resolve()
// create beta release zip file
.then(() => {
const buildsDir = path.join(__dirname, '..', 'builds');
return execSync(`zip -r ${masterZip} ${crxFile} ${zipFile} ${infoFile}`, { cwd: buildsDir });
})
// clean up necessary files
.then(() => {
const buildsDir = path.join(__dirname, '..', 'builds');
const crx = path.join(buildsDir, crxFile);
const zip = path.join(buildsDir, zipFile);
const info = path.join(buildsDir, infoFile);
fs.unlinkSync(crx);
fs.unlinkSync(zip);
fs.unlinkSync(info);
})
// --- Errors ---
.catch((err) => { print(err.toString()); });
17 changes: 17 additions & 0 deletions script/operaBetaZip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const { print } = require('./util');

const versionFilePath = path.join(__dirname, '..', 'VERSION');
const versionFile = fs.readFileSync(versionFilePath);
const VERSION = versionFile.toString().trim();

Promise.resolve()
.then(() => {
const webstoreDir = path.join(__dirname, '..', 'builds', 'webstore');
const output = path.join(__dirname, '..', 'builds', `private_internet_access-opera-v${VERSION}-beta.zip`);
return execSync(`zip -r ${output} .`, { cwd: webstoreDir });
})
// --- Errors ---
.catch((err) => { print(err.toString()); });

0 comments on commit ddedc79

Please sign in to comment.