mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Migrates github publish action to azure pipeline.
This commit is contained in:
parent
c49fcab8f0
commit
1dc513ee38
11 changed files with 242 additions and 311 deletions
34
scripts/ci/monaco-editor-core.sh
Executable file
34
scripts/ci/monaco-editor-core.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# cwd must be the vscode repository.
|
||||
|
||||
yarn --frozen-lockfile --network-timeout 180000
|
||||
yarn playwright-install
|
||||
yarn gulp hygiene
|
||||
yarn valid-layers-check
|
||||
yarn --cwd build compile
|
||||
yarn eslint
|
||||
yarn monaco-compile-check
|
||||
yarn --max_old_space_size=4095 compile
|
||||
|
||||
yarn test-browser --browser chromium
|
||||
|
||||
yarn gulp editor-distro
|
||||
mkdir typings-test
|
||||
|
||||
cd typings-test
|
||||
yarn init -yp
|
||||
../node_modules/.bin/tsc --init
|
||||
echo "import '../out-monaco-editor-core';" > a.ts
|
||||
../node_modules/.bin/tsc --noEmit
|
||||
cd ..
|
||||
|
||||
cd test/monaco
|
||||
yarn run esm-check
|
||||
yarn run bundle-webpack
|
||||
yarn run compile
|
||||
yarn test
|
||||
cd ../..
|
||||
|
||||
# npm package is now in dependencies/vscode/out-monaco-editor-core, ready to be published
|
||||
33
scripts/ci/monaco-editor.sh
Executable file
33
scripts/ci/monaco-editor.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# execute `npm install` to pick up local monaco-editor-core
|
||||
npm install
|
||||
# Install OS Dependencies for Playwright
|
||||
sudo npm run playwright-install-deps
|
||||
# Check prettier
|
||||
npm run prettier-check
|
||||
# Build
|
||||
npm run release
|
||||
|
||||
# Run unit tests
|
||||
npm test
|
||||
|
||||
# Compile webpack plugin
|
||||
npm run compile --prefix webpack-plugin
|
||||
# Package using webpack plugin
|
||||
npm run package-for-smoketest-webpack
|
||||
# Package using esbuild
|
||||
npm run package-for-smoketest-esbuild
|
||||
# Package using vite
|
||||
npm run package-for-smoketest-vite
|
||||
# Package using parcel
|
||||
npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||
|
||||
# Run smoke test
|
||||
npm run smoketest
|
||||
|
||||
# Build website
|
||||
npm run build-website
|
||||
|
||||
# npm package is now ready to be published in ./release
|
||||
56
scripts/ci/prepare-monaco-editor-core-stable.ts
Executable file
56
scripts/ci/prepare-monaco-editor-core-stable.ts
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
import { mkdir, rm } from 'fs/promises';
|
||||
import { join, resolve } from 'path';
|
||||
import { group, gitShallowClone, run, writeJsonFile } from '../lib';
|
||||
|
||||
const selfPath = __dirname;
|
||||
const rootPath = join(selfPath, '..', '..');
|
||||
const dependenciesPath = join(rootPath, 'dependencies');
|
||||
const vscodePath = resolve(dependenciesPath, 'vscode');
|
||||
const monacoEditorPackageJsonPath = resolve(rootPath, 'package.json');
|
||||
|
||||
async function prepareMonacoEditorCoreReleaseStable() {
|
||||
const monacoEditorPackageJson = require(monacoEditorPackageJsonPath) as {
|
||||
version: string;
|
||||
vscodeRef: string;
|
||||
};
|
||||
await prepareMonacoEditorCoreRelease(
|
||||
monacoEditorPackageJson.version,
|
||||
monacoEditorPackageJson.vscodeRef
|
||||
);
|
||||
|
||||
// npm package is now in dependencies/vscode/out-monaco-editor-core, ready to be published
|
||||
}
|
||||
|
||||
async function prepareMonacoEditorCoreRelease(version: string, vscodeRef: string) {
|
||||
await mkdir(vscodePath, { recursive: true });
|
||||
|
||||
await rm(dependenciesPath, { force: true, recursive: true });
|
||||
|
||||
await group('Checkout vscode', async () => {
|
||||
await gitShallowClone(vscodePath, 'https://github.com/microsoft/vscode.git', vscodeRef);
|
||||
});
|
||||
await group('Checkout vscode-loc', async () => {
|
||||
await gitShallowClone(
|
||||
// Must be a sibling to the vscode repository
|
||||
'dependencies/vscode-loc',
|
||||
'https://github.com/microsoft/vscode-loc.git',
|
||||
'main'
|
||||
);
|
||||
});
|
||||
|
||||
await group('Set Version', async () => {
|
||||
const monacoEditorCorePackageJsonSourcePath = resolve(
|
||||
vscodePath,
|
||||
'./build/monaco/package.json'
|
||||
);
|
||||
const packageJson = require(monacoEditorCorePackageJsonSourcePath) as { version: string };
|
||||
packageJson.version = version;
|
||||
await writeJsonFile(monacoEditorPackageJsonPath, packageJson);
|
||||
});
|
||||
|
||||
await group('Building & Testing', async () => {
|
||||
await run(resolve(selfPath, './monaco-editor-core.sh'), { cwd: vscodePath });
|
||||
});
|
||||
}
|
||||
|
||||
prepareMonacoEditorCoreReleaseStable();
|
||||
38
scripts/ci/prepare-monaco-editor-stable.ts
Executable file
38
scripts/ci/prepare-monaco-editor-stable.ts
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
import { readFile } from 'fs/promises';
|
||||
import { join, resolve } from 'path';
|
||||
import { group, run, writeJsonFile } from '../lib';
|
||||
|
||||
const selfPath = __dirname;
|
||||
const rootPath = join(selfPath, '..', '..');
|
||||
const monacoEditorPackageJsonPath = resolve(rootPath, 'package.json');
|
||||
|
||||
async function prepareMonacoEditorReleaseStable() {
|
||||
const monacoEditorPackageJson = JSON.parse(
|
||||
await readFile(monacoEditorPackageJsonPath, { encoding: 'utf-8' })
|
||||
) as { version: string };
|
||||
await prepareMonacoEditorRelease(monacoEditorPackageJson.version);
|
||||
|
||||
// npm package is now in ./release, ready to be published
|
||||
}
|
||||
|
||||
async function prepareMonacoEditorRelease(version: string) {
|
||||
await group('npm ci', async () => {
|
||||
await run('npm ci', { cwd: resolve(rootPath, 'webpack-plugin') });
|
||||
});
|
||||
|
||||
await group('Set Version', async () => {
|
||||
const packageJson = JSON.parse(
|
||||
await readFile(monacoEditorPackageJsonPath, { encoding: 'utf-8' })
|
||||
) as { version: string; devDependencies: Record<string, string> };
|
||||
packageJson.version = version;
|
||||
// TODO packageJson.devDependencies['monaco-editor-core'] = version;
|
||||
|
||||
await writeJsonFile(monacoEditorPackageJsonPath, packageJson);
|
||||
});
|
||||
|
||||
await group('Building & Testing', async () => {
|
||||
await run(resolve(selfPath, './monaco-editor.sh'), { cwd: rootPath });
|
||||
});
|
||||
}
|
||||
|
||||
prepareMonacoEditorReleaseStable();
|
||||
Loading…
Add table
Add a link
Reference in a new issue