Merge pull request #12249 from electron/auto-release-updates

Auto release updates
This commit is contained in:
John Kleinschmidt
2018-03-14 16:32:12 -04:00
committed by GitHub
7 changed files with 132 additions and 32 deletions

View File

@@ -3,7 +3,7 @@ version: 2
jobs:
electron-linux-arm:
docker:
- image: electronbuilds/electron:0.0.6
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: arm
resource_class: 2xlarge
@@ -63,23 +63,19 @@ jobs:
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 8
nvm use 8
echo 'Trying to finish release'
node script/release.js --automaticRelease
releaseExitCode=$?
if [ $? -eq 0 ]; then
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
nvm use system
npm run publish
npm run publish-to-npm
echo 'Release has been published to npm'
else
echo 'Release is not complete, skipping publish for now.'
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping release check'
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Zip out directory
@@ -119,7 +115,7 @@ jobs:
fi
electron-linux-arm64:
docker:
- image: electronbuilds/electron:0.0.6
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: arm64
resource_class: 2xlarge
@@ -174,6 +170,25 @@ jobs:
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Zip out directory
command: |
@@ -212,7 +227,7 @@ jobs:
fi
electron-linux-ia32:
docker:
- image: electronbuilds/electron:0.0.4
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: ia32
DISPLAY: ':99.0'
@@ -271,6 +286,25 @@ jobs:
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Test
environment:
@@ -296,7 +330,7 @@ jobs:
fi
electron-linux-mips64el:
docker:
- image: electronbuilds/electron:0.0.6
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: mips64el
resource_class: xlarge
@@ -351,10 +385,29 @@ jobs:
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
electron-linux-x64:
docker:
- image: electronbuilds/electron:0.0.6
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: x64
DISPLAY: ':99.0'
@@ -413,6 +466,25 @@ jobs:
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Test
environment:

View File

@@ -7,7 +7,7 @@ ENV HOME=/home
RUN chmod a+rwx /home
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install wget used by crash reporter

View File

@@ -46,7 +46,7 @@ RUN apt-get update && apt-get install -y\
xvfb
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install crcmod

View File

@@ -3,7 +3,7 @@ FROM electronbuilds/libchromiumcontent:0.0.4
USER root
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install wget used by crash reporter

View File

@@ -7,7 +7,7 @@ const circleCIJobs = [
'electron-linux-arm',
'electron-linux-arm64',
'electron-linux-ia32',
'electron-linux-mips64el',
// 'electron-linux-mips64el',
'electron-linux-x64'
]

View File

@@ -78,8 +78,10 @@ async function getReleaseNotes (currentBranch) {
base: `v${pkg.version}`,
head: currentBranch
}
let releaseNotes = ''
if (!args.automaticRelease) {
let releaseNotes
if (args.automaticRelease) {
releaseNotes = '## Bug Fixes/Changes \n\n'
} else {
releaseNotes = '(placeholder)\n'
}
console.log(`Checking for commits from ${pkg.version} to ${currentBranch}`)
@@ -95,19 +97,40 @@ async function getReleaseNotes (currentBranch) {
`${currentBranch}, skipping release.`)
process.exit(0)
}
let prCount = 0
const mergeRE = /Merge pull request #(\d+) from .*\n/
const newlineRE = /(.*)\n*.*/
const prRE = /(.* )\(#(\d+)\)(?:.*)/
commitComparison.data.commits.forEach(commitEntry => {
let commitMessage = commitEntry.commit.message
if (commitMessage.toLowerCase().indexOf('merge') > -1) {
let mergeRE = /Merge pull request (#\d+) from .*\n/
if (commitMessage.indexOf('#') > -1) {
let prMatch = commitMessage.match(mergeRE)
commitMessage = commitMessage.replace(mergeRE, '').replace('\n', '')
if (commitMessage.substr(commitMessage.length - 1, commitMessage.length) !== '.') {
commitMessage += '.'
let prNumber
if (prMatch) {
commitMessage = commitMessage.replace(mergeRE, '').replace('\n', '')
let newlineMatch = commitMessage.match(newlineRE)
if (newlineMatch) {
commitMessage = newlineMatch[1]
}
prNumber = prMatch[1]
} else {
prMatch = commitMessage.match(prRE)
if (prMatch) {
commitMessage = prMatch[1].trim()
prNumber = prMatch[2]
}
}
if (prMatch) {
if (commitMessage.substr(commitMessage.length - 1, commitMessage.length) !== '.') {
commitMessage += '.'
}
releaseNotes += `* ${commitMessage} #${prNumber} \n\n`
prCount++
}
releaseNotes += `${commitMessage} ${prMatch[1]} \n\n`
}
})
console.log(`${pass} Done generating release notes for ${currentBranch}.`)
console.log(`${pass} Done generating release notes for ${currentBranch}. Found ${prCount} PRs.`)
return releaseNotes
}
@@ -187,7 +210,12 @@ async function tagRelease (version) {
async function verifyNewVersion () {
let newVersion = getNewVersion(true)
let response = await promptForVersion(newVersion)
let response
if (args.automaticRelease) {
response = 'y'
} else {
response = await promptForVersion(newVersion)
}
if (response.match(/^y/i)) {
console.log(`${pass} Starting release of ${newVersion}`)
} else {
@@ -218,7 +246,7 @@ async function prepareRelease (isBeta, notesOnly) {
let currentBranch = await getCurrentBranch(gitDir)
if (notesOnly) {
let releaseNotes = await getReleaseNotes(currentBranch)
console.log(`Draft release notes are: ${releaseNotes}`)
console.log(`Draft release notes are: \n${releaseNotes}`)
} else {
await verifyNewVersion()
await createRelease(currentBranch, isBeta)

View File

@@ -97,7 +97,7 @@ function assetsForVersion (version, validatingRelease) {
`electron-${version}-linux-armv7l.zip`,
`electron-${version}-linux-ia32-symbols.zip`,
`electron-${version}-linux-ia32.zip`,
`electron-${version}-linux-mips64el.zip`,
// `electron-${version}-linux-mips64el.zip`,
`electron-${version}-linux-x64-symbols.zip`,
`electron-${version}-linux-x64.zip`,
`electron-${version}-mas-x64-dsym.zip`,
@@ -116,7 +116,7 @@ function assetsForVersion (version, validatingRelease) {
`ffmpeg-${version}-linux-arm64.zip`,
`ffmpeg-${version}-linux-armv7l.zip`,
`ffmpeg-${version}-linux-ia32.zip`,
`ffmpeg-${version}-linux-mips64el.zip`,
// `ffmpeg-${version}-linux-mips64el.zip`,
`ffmpeg-${version}-linux-x64.zip`,
`ffmpeg-${version}-mas-x64.zip`,
`ffmpeg-${version}-win32-ia32.zip`,