Adds WIP support for a daily job pipeline

This commit is contained in:
Orta Therox 2019-07-24 11:05:54 -04:00
parent 8440cba727
commit e7291e938a
3 changed files with 97 additions and 16 deletions

25
azure-pipelines.yml Normal file
View file

@ -0,0 +1,25 @@
# triggered by schedule at 5am to try make sure it's done after the TS daily build
schedules:
- cron: '0 5 * * *'
displayName: Daily midnight build
branches:
include:
- master
always: true
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: vscode_typescript_next_deploy_key
displayName: 'Get the deploy key'
- bash: |
npm run run-nightly
npm publish
displayName: 'Publish to NPM'

View file

@ -9,7 +9,7 @@
"watch": "tsc -p ./src --watch",
"prepublishOnly": "npm run compile && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts",
"import-typescript": "node ./scripts/importTypescript",
"run-nightly": "node ./scripts/runDaily",
"run-nightly": "node ./scripts/runDaily"
},
"author": "Microsoft Corporation",
"license": "MIT",
@ -24,6 +24,7 @@
"monaco-editor-core": "^0.16.0",
"monaco-languages": "^1.7.0",
"monaco-plugin-helpers": "^1.0.2",
"node-fetch": "^2.6.0",
"requirejs": "^2.3.6",
"typescript": "^3.5.1",
"uglify-js": "^3.4.9"

View file

@ -4,10 +4,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const {execSync} = require('child_process');
const {join} = require('path')
const {readFileSync, writeFileSync} = require("fs")
const { execSync } = require("child_process");
const { join } = require("path");
const { readFileSync, writeFileSync } = require("fs");
const fetch = require("node-fetch");
try {
// Update to the daily build
execSync("npm install --save typescript@next")
@ -25,3 +27,56 @@ const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"))
package.version = tsPackage.version
writeFileSync(packagePath, JSON.stringify(package), "utf8")
// Update the dts files
execSync("npm run compile")
} catch (error) {
// If it fails, post a message into the TS teams bot channel
const teamsURL = process.env.TEAMS_INCOMING_WEBHOOK_URL
if(!teamsURL) return
const message = {
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
summary: "Issue with Monaco-TypeScript daily build",
themeColor: "0078D7",
title: 'Issue opened: "Push notifications not working"',
sections: [
{
activityTitle: "Azure Pipelines",
activitySubtitle: "9/13/2016, 11:46am",
activityImage:
"https://avatars2.githubusercontent.com/ml/1303?s=140&v=4",
facts: [
{
name: "Error:",
value: error.name
},
{
name: "Description:",
value: error.message || error.description
}
]
}
],
potentialAction: [
{
"@type": "OpenUri",
name: "View in Pipelines",
targets: [
{
os: "default",
uri: "https://link.com"
}
]
}
]
};
fetch(teamsURL, {
method: "post",
body: JSON.stringify(message),
headers: { "Content-Type": "application/json" }
});
}