Skip to content

Build Multi-Platform #10

Build Multi-Platform

Build Multi-Platform #10

Workflow file for this run

name: Build Multi-Platform
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write # reuired for creating a release
jobs:
build:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux-x64
target: x86_64-unknown-linux-gnu
- os: macos-latest
platform: darwin-x64
target: x86_64-apple-darwin
- os: macos-latest
platform: darwin-arm64
target: aarch64-apple-darwin
- os: windows-latest
platform: win32-x64
target: x86_64-pc-windows-msvc
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev
- name: Build LSP server
working-directory: server/wa2lsp
run: cargo build --release --target ${{ matrix.target }}
- name: Debug - Find the binary (Unix)
if: matrix.os != 'windows-latest'
run: |
echo "=== Searching for wa2lsp binary ==="
find . -name "wa2lsp" 2>/dev/null || echo "Binary not found"
echo "=== Target directory contents ==="
ls -la target/${{ matrix.target }}/release/ || echo "Release directory not found"
- name: Debug - Find the binary (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Write-Host "=== Searching for wa2lsp.exe ==="
Get-ChildItem -Path . -Recurse -Filter "wa2lsp.exe" -ErrorAction SilentlyContinue | Select-Object FullName
Write-Host "=== Target directory contents ==="
Get-ChildItem -Path "target\${{ matrix.target }}\release" -ErrorAction SilentlyContinue
- name: Copy binary (Unix)
if: matrix.os != 'windows-latest'
run: |
mkdir -p client/wa2/bin
cp target/${{ matrix.target }}/release/wa2lsp client/wa2/bin/
- name: Copy binary (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path client/wa2/bin
Copy-Item target/${{ matrix.target }}/release/wa2lsp.exe client/wa2/bin/
- name: Install npm dependencies
working-directory: client/wa2
run: npm ci
- name: Compile TypeScript
working-directory: client/wa2
run: npm run compile
- name: Package extension
working-directory: client/wa2
run: npx @vscode/vsce package --target ${{ matrix.platform }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: wa2-${{ matrix.platform }}
path: client/wa2/*.vsix
retention-days: 30
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**/*.vsix
draft: true
generate_release_notes: true