-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Opera Beta Release Process scripts and docs
- Loading branch information
Showing
5 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); }); |