diff --git a/build/run-build-and-send-screenshot.scpt b/build/run-build-and-send-screenshot.scpt new file mode 100644 index 000000000..f9fb4433d Binary files /dev/null and b/build/run-build-and-send-screenshot.scpt differ diff --git a/build/tasks/publish-nylas-build-task.coffee b/build/tasks/publish-nylas-build-task.coffee index 9e3b62c48..885f31944 100644 --- a/build/tasks/publish-nylas-build-task.coffee +++ b/build/tasks/publish-nylas-build-task.coffee @@ -17,6 +17,20 @@ module.exports = (grunt) -> publishPath = -> process.env.PUBLISH_PATH ? defaultPublishPath() + runEmailIntegrationTest = (s3Client) -> + buildDir = grunt.config.get('atom.buildDir') + new Promise (resolve, reject) -> + appToRun = path.join(buildDir, appName()) + scriptToRun = "./build/run-build-and-send-screenshot.scpt" + spawn + cmd: "osascript" + args: [scriptToRun, appToRun, getVersion()] + , (error) -> + if error + process.chdir(orig) + reject(error) + return + postToSlack = (msg) -> new Promise (resolve, reject) -> url = "https://hooks.slack.com/services/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" @@ -126,23 +140,23 @@ module.exports = (grunt) -> grunt.registerTask "publish-nylas-build", "Publish Nylas build", -> done = @async() - dmgPath = path.join(grunt.config.get('atom.buildDir'), dmgName()) + runEmailIntegrationTest().then -> + dmgPath = path.join(grunt.config.get('atom.buildDir'), dmgName()) - if not fs.existsSync dmgPath - grunt.log.error "DMG does not exist at #{dmgPath}. Run script/grunt build first." - cp dmgPath, path.join(publishPath(), dmgName()) + if not fs.existsSync dmgPath + grunt.log.error "DMG does not exist at #{dmgPath}. Run script/grunt build first." + cp dmgPath, path.join(publishPath(), dmgName()) - grunt.log.ok "Copied DMG to #{publishPath()}" - if publishPath() is defaultPublishPath() - grunt.log.ok "Set the PUBLISH_PATH environment variable to change where Edgehill copies the built file to." + grunt.log.ok "Copied DMG to #{publishPath()}" + if publishPath() is defaultPublishPath() + grunt.log.ok "Set the PUBLISH_PATH environment variable to change where Edgehill copies the built file to." - s3Client = prepareS3() - - if s3Client - Promise.all([uploadDMGToS3(s3Client), uploadZipToS3(s3Client)]) - .then -> - done() - .catch (err) -> - grunt.log.error(err) + s3Client = prepareS3() + if s3Client + Promise.all([uploadDMGToS3(s3Client), uploadZipToS3(s3Client)]).then -> + done() + .catch (err) -> + grunt.log.error(err) + return false + else return false - else return false diff --git a/script/cibuild b/script/cibuild index ae91fd398..2ef38cca1 100755 --- a/script/cibuild +++ b/script/cibuild @@ -7,7 +7,6 @@ # The credentials for the Keychain are availble via the Jenkins-injected # KEYCHAIN_ACCESS environment variable. -rm -rf ~/.nylas; echo "---> $(npm --version)" echo "---> $(node --version)" script/bootstrap