Added changelog to the release description
This commit is contained in:
parent
78bdf0a486
commit
2280fcfc84
|
@ -16,8 +16,21 @@ async function publishRelease() {
|
|||
const CIRCLE_SHA1 = process.env.CIRCLE_SHA1
|
||||
console.log(`VERSION: ${VERSION}, CIRCLE_SHA1: ${CIRCLE_SHA1}`);
|
||||
let releaseId;
|
||||
const CREATE_RELEASE_URI = `https://api.github.com/repos/poanetwork/metamask-extension/releases`;
|
||||
const CREATE_RELEASE_URI = `https://api.github.com/repos/natlg/metamask-extension/releases`;
|
||||
console.log(`CREATE_RELEASE_URI: ${CREATE_RELEASE_URI}`)
|
||||
let changelog = "";
|
||||
try {
|
||||
changelog = fs.readFileSync('./CHANGELOG.md').toString().split(VERSION)[1].split('##')[0].trim();
|
||||
} catch (err) {
|
||||
console.error(`Error in getting changelog: ${err}`)
|
||||
}
|
||||
// remove first line with date
|
||||
let newLineIndex = changelog.indexOf('\n');
|
||||
let changes = "New release is ready.";
|
||||
if (newLineIndex !== -1) {
|
||||
changes = changelog.slice(newLineIndex + 1);
|
||||
}
|
||||
console.log(`changes: ${changes}`);
|
||||
|
||||
request({
|
||||
method: 'POST',
|
||||
|
@ -27,7 +40,7 @@ async function publishRelease() {
|
|||
'Authorization': `token ${GITHUB_TOKEN}`
|
||||
},
|
||||
body: JSON.stringify({
|
||||
body: "Release is ready",
|
||||
body: changes,
|
||||
tag_name: `v${VERSION}`,
|
||||
name: `Version ${VERSION}`,
|
||||
target_commitish: CIRCLE_SHA1,
|
||||
|
@ -62,7 +75,7 @@ async function publishRelease() {
|
|||
* @returns {Promise.<*>}
|
||||
*/
|
||||
async function uploadAsset(path, name, releaseId) {
|
||||
const UPLOAD_ASSET_URL = `https://uploads.github.com/repos/poanetwork/metamask-extension/releases/${releaseId}/assets?name=${name}&label=${name}`;
|
||||
const UPLOAD_ASSET_URL = `https://uploads.github.com/repos/natlg/metamask-extension/releases/${releaseId}/assets?name=${name}&label=${name}`;
|
||||
console.log(`UPLOAD_ASSET_URL: ${UPLOAD_ASSET_URL}`);
|
||||
return request({
|
||||
method: 'POST',
|
||||
|
|
Loading…
Reference in New Issue