Skip to content

Commit

Permalink
ci - add source-map-explorer builds to metamaskbot comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis committed Sep 10, 2019
1 parent 68092d8 commit f06a1b3
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions development/metamaskbot-build-announce.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ async function start () {
const SHORT_SHA1 = CIRCLE_SHA1.slice(0, 7)
const BUILD_LINK_BASE = `https://${CIRCLE_BUILD_NUM}-42009758-gh.circle-artifacts.com/0`

const CHROME = `${BUILD_LINK_BASE}/builds/metamask-chrome-${VERSION}.zip`
const FIREFOX = `${BUILD_LINK_BASE}/builds/metamask-firefox-${VERSION}.zip`
const EDGE = `${BUILD_LINK_BASE}/builds/metamask-edge-${VERSION}.zip`
const OPERA = `${BUILD_LINK_BASE}/builds/metamask-opera-${VERSION}.zip`

const commentBody = `Builds ready [${SHORT_SHA1}]: <a href="${CHROME}">chrome</a>, <a href="${FIREFOX}">firefox</a>, <a href="${EDGE}">edge</a>, <a href="${OPERA}">opera</a>`
// build the github comment content

// links to extension builds
const buildLinks = platforms.map(platform => {
const url = `${BUILD_LINK_BASE}/builds/metamask-${platform}-${VERSION}.zip`
return `<a href="${url}">${platform}</a>`
}).join(', ')

// links to bundle browser builds
const bundleLinks = bundles.map(bundle => {
const url = `${BUILD_LINK_BASE}/build-artifacts/source-map-explorer/${bundle}.html`
return `<a href="${url}">${bundle}</a>`
}).join(', ')

const exposedContent = `Builds ready [${SHORT_SHA1}]`
const hiddenContent = `<ul><li>builds: ${buildLinks}</li><li>bundles: ${bundleLinks}</li></ul>`
const commentBody = `<details><summary>${exposedContent}</summary>${hiddenContent}</details>`

const JSON_PAYLOAD = JSON.stringify({ body: commentBody })
const POST_COMMENT_URI = `https://api.github.com/repos/metamask/metamask-extension/issues/${CIRCLE_PR_NUMBER}/comments`
Expand Down

0 comments on commit f06a1b3

Please sign in to comment.