mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
b2
This commit is contained in:
parent
e33b3ceae1
commit
f1a31246b2
1 changed files with 407 additions and 0 deletions
407
.github/workflows/b2.yml
vendored
Normal file
407
.github/workflows/b2.yml
vendored
Normal file
|
|
@ -0,0 +1,407 @@
|
|||
name: VS Code Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_macos:
|
||||
description: 'Build macOS'
|
||||
type: boolean
|
||||
default: true
|
||||
build_macos_arm64:
|
||||
description: 'Build macOS ARM64'
|
||||
type: boolean
|
||||
default: true
|
||||
build_macos_universal:
|
||||
description: 'Build macOS Universal'
|
||||
type: boolean
|
||||
default: true
|
||||
build_linux:
|
||||
description: 'Build Linux x64'
|
||||
type: boolean
|
||||
default: true
|
||||
build_linux_arm64:
|
||||
description: 'Build Linux ARM64'
|
||||
type: boolean
|
||||
default: false
|
||||
build_windows:
|
||||
description: 'Build Windows'
|
||||
type: boolean
|
||||
default: true
|
||||
quality:
|
||||
description: 'Quality (insider or stable)'
|
||||
type: choice
|
||||
options:
|
||||
- insider
|
||||
- stable
|
||||
default: 'insider'
|
||||
|
||||
env:
|
||||
VSCODE_QUALITY: ${{ github.event.inputs.quality }}
|
||||
NPM_REGISTRY: 'https://registry.npmjs.org/'
|
||||
VSCODE_ARCH: 'x64'
|
||||
VSCODE_CIBUILD: false
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Compile
|
||||
run: |
|
||||
npm run compile
|
||||
|
||||
- name: Package Compilation Output
|
||||
run: |
|
||||
mkdir -p .build
|
||||
tar -czf compilation.tar.gz .build out-* test/integration/browser/out test/smoke/out test/automation/out
|
||||
|
||||
- name: Upload Compilation Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: compilation
|
||||
path: compilation.tar.gz
|
||||
|
||||
compile-cli:
|
||||
runs-on: ubuntu-latest
|
||||
needs: compile
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Build CLI
|
||||
run: |
|
||||
cd cli
|
||||
cargo build --release --bin=code
|
||||
|
||||
- name: Upload CLI Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode_cli
|
||||
path: cli/target/release/code
|
||||
|
||||
build-macos:
|
||||
if: ${{ github.event.inputs.build_macos == 'true' }}
|
||||
runs-on: macos-latest
|
||||
needs: [compile, compile-cli]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Download Compilation
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: compilation
|
||||
|
||||
- name: Extract Compilation
|
||||
run: tar -xzf compilation.tar.gz
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build macOS x64
|
||||
run: |
|
||||
npm run gulp vscode-darwin-x64-min-ci
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode_cli
|
||||
path: cli-bin
|
||||
|
||||
- name: Integrate CLI
|
||||
run: |
|
||||
APP_ROOT="$(pwd)/../VSCode-darwin-x64"
|
||||
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
||||
APP_PATH="$APP_ROOT/$APP_NAME"
|
||||
CLI_APP_NAME=$(node -p "require(\"$APP_PATH/Contents/Resources/app/product.json\").tunnelApplicationName")
|
||||
mkdir -p "$APP_PATH/Contents/Resources/app/bin"
|
||||
cp cli-bin/code "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME"
|
||||
chmod +x "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME"
|
||||
|
||||
- name: Package macOS App
|
||||
run: |
|
||||
ARCHIVE_PATH="VSCode-darwin-x64.zip"
|
||||
(cd ../VSCode-darwin-x64 && zip -r -X -y $(pwd)/$ARCHIVE_PATH *)
|
||||
|
||||
- name: Upload macOS App
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-darwin-x64
|
||||
path: VSCode-darwin-x64.zip
|
||||
|
||||
build-macos-arm64:
|
||||
if: ${{ github.event.inputs.build_macos_arm64 == 'true' }}
|
||||
runs-on: macos-latest
|
||||
needs: [compile, compile-cli]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Download Compilation
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: compilation
|
||||
|
||||
- name: Extract Compilation
|
||||
run: tar -xzf compilation.tar.gz
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build macOS ARM64
|
||||
run: |
|
||||
npm run gulp vscode-darwin-arm64-min-ci
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode_cli
|
||||
path: cli-bin
|
||||
|
||||
- name: Integrate CLI
|
||||
run: |
|
||||
APP_ROOT="$(pwd)/../VSCode-darwin-arm64"
|
||||
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
||||
APP_PATH="$APP_ROOT/$APP_NAME"
|
||||
CLI_APP_NAME=$(node -p "require(\"$APP_PATH/Contents/Resources/app/product.json\").tunnelApplicationName")
|
||||
mkdir -p "$APP_PATH/Contents/Resources/app/bin"
|
||||
cp cli-bin/code "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME"
|
||||
chmod +x "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME"
|
||||
|
||||
- name: Package macOS App
|
||||
run: |
|
||||
ARCHIVE_PATH="VSCode-darwin-arm64.zip"
|
||||
(cd ../VSCode-darwin-arm64 && zip -r -X -y $(pwd)/$ARCHIVE_PATH *)
|
||||
|
||||
- name: Upload macOS App
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-darwin-arm64
|
||||
path: VSCode-darwin-arm64.zip
|
||||
|
||||
build-macos-universal:
|
||||
if: ${{ github.event.inputs.build_macos_universal == 'true' && github.event.inputs.build_macos == 'true' && github.event.inputs.build_macos_arm64 == 'true' }}
|
||||
runs-on: macos-latest
|
||||
needs: [build-macos, build-macos-arm64]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Download x64 Build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode-darwin-x64
|
||||
|
||||
- name: Download ARM64 Build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode-darwin-arm64
|
||||
|
||||
- name: Extract Builds
|
||||
run: |
|
||||
mkdir -p VSCode-darwin-x64
|
||||
mkdir -p VSCode-darwin-arm64
|
||||
unzip VSCode-darwin-x64.zip -d VSCode-darwin-x64
|
||||
unzip VSCode-darwin-arm64.zip -d VSCode-darwin-arm64
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Create Universal Build
|
||||
run: |
|
||||
node build/darwin/create-universal-app.js $(pwd)
|
||||
|
||||
- name: Package Universal App
|
||||
run: |
|
||||
ARCHIVE_PATH="VSCode-darwin-universal.zip"
|
||||
(cd VSCode-darwin-universal && zip -r -X -y $(pwd)/$ARCHIVE_PATH *)
|
||||
|
||||
- name: Upload Universal App
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-darwin-universal
|
||||
path: VSCode-darwin-universal.zip
|
||||
|
||||
build-linux:
|
||||
if: ${{ github.event.inputs.build_linux == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [compile, compile-cli]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
|
||||
npm ci
|
||||
|
||||
- name: Download Compilation
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: compilation
|
||||
|
||||
- name: Extract Compilation
|
||||
run: tar -xzf compilation.tar.gz
|
||||
|
||||
- name: Build Linux x64
|
||||
run: |
|
||||
npm run gulp vscode-linux-x64-min-ci
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode_cli
|
||||
path: cli-bin
|
||||
|
||||
- name: Integrate CLI
|
||||
run: |
|
||||
CLI_APP_NAME=$(node -p "require(\"../VSCode-linux-x64/resources/app/product.json\").tunnelApplicationName")
|
||||
mkdir -p "../VSCode-linux-x64/bin"
|
||||
cp cli-bin/code "../VSCode-linux-x64/bin/$CLI_APP_NAME"
|
||||
chmod +x "../VSCode-linux-x64/bin/$CLI_APP_NAME"
|
||||
|
||||
- name: Create .tar.gz Archive
|
||||
run: |
|
||||
ARCHIVE_PATH="VSCode-linux-x64.tar.gz"
|
||||
(cd .. && tar -czf $(pwd)/$ARCHIVE_PATH VSCode-linux-x64)
|
||||
|
||||
- name: Upload Linux Build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-linux-x64-archive
|
||||
path: VSCode-linux-x64.tar.gz
|
||||
|
||||
- name: Build .deb Package
|
||||
run: |
|
||||
npm run gulp vscode-linux-x64-prepare-deb
|
||||
npm run gulp vscode-linux-x64-build-deb
|
||||
|
||||
- name: Upload .deb Package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-linux-x64-deb
|
||||
path: .build/linux/deb/*/deb/*.deb
|
||||
|
||||
- name: Build .rpm Package
|
||||
run: |
|
||||
npm run gulp vscode-linux-x64-prepare-rpm
|
||||
npm run gulp vscode-linux-x64-build-rpm
|
||||
|
||||
- name: Upload .rpm Package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-linux-x64-rpm
|
||||
path: .build/linux/rpm/*/*.rpm
|
||||
|
||||
build-windows:
|
||||
if: ${{ github.event.inputs.build_windows == 'true' }}
|
||||
runs-on: windows-latest
|
||||
needs: [compile, compile-cli]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Download Compilation
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: compilation
|
||||
|
||||
- name: Extract Compilation
|
||||
shell: powershell
|
||||
run: tar -xzf compilation.tar.gz
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Windows x64
|
||||
run: |
|
||||
npm run gulp vscode-win32-x64-min-ci
|
||||
npm run gulp vscode-win32-x64-inno-updater
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode_cli
|
||||
path: cli-bin
|
||||
|
||||
- name: Integrate CLI
|
||||
shell: powershell
|
||||
run: |
|
||||
$AppProductJson = Get-Content -Raw -Path "../VSCode-win32-x64/resources/app/product.json" | ConvertFrom-Json
|
||||
$CliAppName = $AppProductJson.tunnelApplicationName
|
||||
$AppName = $AppProductJson.applicationName
|
||||
mkdir -Force "../VSCode-win32-x64/bin"
|
||||
Copy-Item -Path "cli-bin/code" -Destination "../VSCode-win32-x64/bin/$CliAppName.exe"
|
||||
|
||||
- name: Package Windows Build
|
||||
shell: powershell
|
||||
run: |
|
||||
$ArchivePath = "VSCode-win32-x64.zip"
|
||||
Compress-Archive -Path "../VSCode-win32-x64/*" -DestinationPath $ArchivePath
|
||||
|
||||
- name: Upload Windows Build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-win32-x64-archive
|
||||
path: VSCode-win32-x64.zip
|
||||
|
||||
- name: Build User Setup
|
||||
run: |
|
||||
npm run gulp vscode-win32-x64-user-setup
|
||||
|
||||
- name: Upload User Setup
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-win32-x64-user-setup
|
||||
path: .build/win32-x64/user-setup/VSCodeSetup.exe
|
||||
Loading…
Reference in a new issue