Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 271 additions & 0 deletions .github/workflows/oss-build-fast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
name: Fast OSS Build

on:
workflow_dispatch:
push:
branches:
- copilot/add-github-actions-workflow

jobs:
linux:
name: Linux x64
runs-on: ubuntu-latest
timeout-minutes: 60
env:
VSCODE_ARCH: x64
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Compute node modules cache key
id: nodeModulesCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)" >> $GITHUB_OUTPUT

- name: Cache node modules
id: cacheNodeModules
uses: actions/cache@v4
with:
path: '**/node_modules'

Check warning on line 31 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

31:81 [line-length] line too long (154 > 80 characters)
key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModulesLinux-

- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache yarn directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v4
with:
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-yarnCacheDir-

Check warning on line 46 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

46:81 [line-length] line too long (148 > 80 characters)

- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: yarn --frozen-lockfile --network-timeout 180000

- name: Compute builtin extensions cache key
id: builtInExtensionsCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeBuiltInDepsCacheKey.js)" >> $GITHUB_OUTPUT

- name: Cache builtin extensions
id: cache-builtin-extensions
uses: actions/cache@v4
with:
path: .build/builtInExtensions
key: builtInExtensions-${{ steps.builtInExtensionsCacheKey.outputs.value }}
restore-keys: builtInExtensions-

- name: Download built-in extensions
if: steps.cache-builtin-extensions.outputs.cache-hit != 'true'
run: node build/lib/builtInExtensions.ts
env:

Check warning on line 70 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

70:81 [line-length] line too long (91 > 80 characters)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Check warning on line 72 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

72:81 [line-length] line too long (96 > 80 characters)
- name: Transpile client & extensions
run: npm run gulp transpile-client transpile-extensions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package

Check warning on line 78 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

78:81 [line-length] line too long (98 > 80 characters)
run: npm run gulp vscode-transpile-linux-$VSCODE_ARCH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create archive
working-directory: ..
run: |
mkdir -p .build/linux/archive
tar -czf .build/linux/archive/VSCode-linux-$VSCODE_ARCH.tar.gz VSCode-linux-$VSCODE_ARCH

- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: vscode-linux-${{ env.VSCODE_ARCH }}
path: ../.build/linux/archive/VSCode-linux-${{ env.VSCODE_ARCH }}.tar.gz
retention-days: 7

darwin:
name: macOS arm64
runs-on: macos-latest
timeout-minutes: 60
env:
VSCODE_ARCH: arm64
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

Check warning on line 108 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

108:81 [line-length] line too long (98 > 80 characters)
- name: Compute node modules cache key
id: nodeModulesCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)" >> $GITHUB_OUTPUT

- name: Cache node modules
id: cacheNodeModules

Check warning on line 114 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

114:81 [line-length] line too long (82 > 80 characters)
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModulesLinux-

- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache yarn directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v4
with:
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-yarnCacheDir-

Check warning on line 133 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

133:81 [line-length] line too long (157 > 80 characters)
- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: yarn --frozen-lockfile --network-timeout 180000

- name: Compute builtin extensions cache key
id: builtInExtensionsCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeBuiltInDepsCacheKey.js)" >> $GITHUB_OUTPUT

- name: Cache builtin extensions
id: cache-builtin-extensions
uses: actions/cache@v4
with:
path: .build/builtInExtensions
key: builtInExtensions-${{ steps.builtInExtensionsCacheKey.outputs.value }}
restore-keys: builtInExtensions-

- name: Download built-in extensions
if: steps.cache-builtin-extensions.outputs.cache-hit != 'true'
run: node build/lib/builtInExtensions.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Transpile client & extensions
run: npm run gulp transpile-client transpile-extensions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
run: npm run gulp vscode-transpile-darwin-$VSCODE_ARCH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Check warning on line 168 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

168:81 [line-length] line too long (91 > 80 characters)
- name: Create archive
working-directory: ..

Check warning on line 170 in .github/workflows/oss-build-fast.yml

View workflow job for this annotation

GitHub Actions / copilot

170:81 [line-length] line too long (96 > 80 characters)
run: |
mkdir -p .build/darwin/archive
tar -czf .build/darwin/archive/VSCode-darwin-$VSCODE_ARCH.tar.gz VSCode-darwin-$VSCODE_ARCH

- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: vscode-darwin-${{ env.VSCODE_ARCH }}
path: ../.build/darwin/archive/VSCode-darwin-${{ env.VSCODE_ARCH }}.tar.gz
retention-days: 7

windows:
name: Windows x64
runs-on: windows-latest
timeout-minutes: 60
env:
VSCODE_ARCH: x64
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Compute node modules cache key
id: nodeModulesCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)" >> $env:GITHUB_OUTPUT

- name: Cache node modules
id: cacheNodeModules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModulesLinux-

- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "dir=$(yarn cache dir)" >> $env:GITHUB_OUTPUT

- name: Cache yarn directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v4
with:
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-yarnCacheDir-

- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: yarn --frozen-lockfile --network-timeout 180000

- name: Compute builtin extensions cache key
id: builtInExtensionsCacheKey
run: echo "value=$(node build/azure-pipelines/common/computeBuiltInDepsCacheKey.js)" >> $env:GITHUB_OUTPUT

- name: Cache builtin extensions
id: cache-builtin-extensions
uses: actions/cache@v4
with:
path: .build/builtInExtensions
key: builtInExtensions-${{ steps.builtInExtensionsCacheKey.outputs.value }}
restore-keys: builtInExtensions-

- name: Download built-in extensions
if: steps.cache-builtin-extensions.outputs.cache-hit != 'true'
shell: pwsh
run: node build/lib/builtInExtensions.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Transpile client & extensions
shell: pwsh
run: npm run gulp transpile-client transpile-extensions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build package
shell: pwsh
run: npm run gulp vscode-transpile-win32-$env:VSCODE_ARCH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create archive
shell: pwsh
working-directory: ..
run: |
New-Item -ItemType Directory -Force -Path .build/win32-$env:VSCODE_ARCH/archive
$archivePath = ".build/win32-$env:VSCODE_ARCH/archive/VSCode-win32-$env:VSCODE_ARCH.zip"
7z.exe a -tzip $archivePath VSCode-win32-$env:VSCODE_ARCH/* "-xr!CodeSignSummary*.md"

- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: vscode-win32-${{ env.VSCODE_ARCH }}
path: ../.build/win32-${{ env.VSCODE_ARCH }}/archive/VSCode-win32-${{ env.VSCODE_ARCH }}.zip
retention-days: 7
58 changes: 57 additions & 1 deletion build/gulpfile.vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import electron from '@vscode/gulp-electron';
import jsonEditor from 'gulp-json-editor';
import * as util from './lib/util.ts';
import { getVersion } from './lib/getVersion.ts';
import { readISODate } from './lib/date.ts';
import { readISODate, writeISODate } from './lib/date.ts';
import * as task from './lib/task.ts';
import buildfile from './buildfile.ts';
import * as optimize from './lib/optimize.ts';
Expand Down Expand Up @@ -548,6 +548,62 @@ BUILD_TARGETS.forEach(buildTarget => {
}
});

// Transpile-only tasks for fast builds without minification
BUILD_TARGETS.forEach(buildTarget => {
const dashed = (str: string) => (str ? `-${str}` : ``);
const platform = buildTarget.platform;
const arch = buildTarget.arch;
const opts = buildTarget.opts;

// Create custom resources list that uses 'out' instead of 'out-build'
const vscodeResourcesTranspiled = vscodeResourceIncludes.map(resource => resource.replace(/^out-build/, 'out')).concat([
'!out/vs/code/browser/**',
'!out/vs/editor/standalone/**',
'!out/vs/code/**/*-dev.html',
'!out/vs/workbench/contrib/issue/**/*-dev.html',
'!**/test/**'
]);

// Create a custom bundle task that uses transpiled output (out) instead of compiled output (out-build)
const bundleTranspiledVSCodeTask = task.define(`bundle-transpiled-vscode${dashed(platform)}${dashed(arch)}`, task.series(
util.rimraf('out-vscode'),
optimize.bundleTask(
{
out: 'out-vscode',
esm: {
src: 'out', // Use transpiled output instead of compiled
entryPoints: [
...vscodeEntryPoints,
...bootstrapEntryPoints
],
resources: vscodeResourcesTranspiled,
skipTSBoilerplateRemoval: entryPoint => entryPoint === 'vs/code/electron-browser/workbench/workbench'
}
}
)
));

const sourceFolderName = 'out-vscode'; // Use bundled output
const destinationFolderName = `VSCode${dashed(platform)}${dashed(arch)}`;

const tasks = [
writeISODate('out-build'), // Create date file for packaging
compileNativeExtensionsBuildTask,
compileExtensionMediaBuildTask,
bundleTranspiledVSCodeTask,
util.rimraf(path.join(buildRoot, destinationFolderName)),
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
];

if (platform === 'win32') {
tasks.push(patchWin32DependenciesTask(destinationFolderName));
}

const vscodeTranspileTask = task.define(`vscode-transpile${dashed(platform)}${dashed(arch)}`, task.series(...tasks));
gulp.task(vscodeTranspileTask);
});


// #region nls

const innoSetupConfig: Record<string, { codePage: string; defaultInfo?: { name: string; id: string } }> = {
Expand Down
Loading