From 8e01f87054f27ebabe8f534ef62965607ce3497c Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Wed, 31 Jul 2019 11:32:33 -0400 Subject: [PATCH] Improvements to the monaco-typescript daily deploy --- azure-pipelines.yml | 6 +++- package-lock.json | 2 +- package.json | 1 - scripts/runDaily.js | 71 ++++++--------------------------------------- 4 files changed, 15 insertions(+), 65 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad1fd8f8..5a43b39e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,10 @@ steps: - bash: | npm install npm run run-nightly - npm publish + displayName: 'Update & Build' + +- bash: | + echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc + npm publish --tag next displayName: 'Publish to NPM' diff --git a/package-lock.json b/package-lock.json index e530400e..4882463b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "monaco-typescript", - "version": "3.5.0", + "version": "3.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9143bfac..c4e206c9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "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" diff --git a/scripts/runDaily.js b/scripts/runDaily.js index 8e31d6f6..21a0b1fb 100644 --- a/scripts/runDaily.js +++ b/scripts/runDaily.js @@ -7,76 +7,23 @@ 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") + execSync("npm install --save typescript@next"); // Update the dts files - execSync("npm run import-typescript") + execSync("npm run import-typescript"); // Sync the versions - const packagePath = join(__dirname, "../package.json") - const package = JSON.parse(readFileSync(packagePath, "utf8")) + const packagePath = join(__dirname, "../package.json"); + const package = JSON.parse(readFileSync(packagePath, "utf8")); - const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json") - const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8")) + const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json"); + const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8")); // Set the monaco-typescript version to directly match the typescript nightly version - package.version = tsPackage.version - writeFileSync(packagePath, JSON.stringify(package), "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" } - }); -} - + execSync("npm run compile");