Skip to content

Update go.yml

Update go.yml #18

Workflow file for this run

name: Go Cross-Platform Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
- os: windows-latest
goos: windows
- os: macos-latest
goos: darwin
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Install Linux GUI dependencies
if: matrix.goos == 'linux'
run: |
sudo apt update
sudo apt install -y \
libx11-dev \
libxkbcommon-dev \
libwayland-dev \
pkg-config \
libvulkan-dev \
libegl1-mesa-dev \
libgl1-mesa-dev
- name: Ensure Xcode tools
if: matrix.goos == 'darwin'
run: xcode-select --install || true
- name: Install dependencies
if: matrix.goos == 'linux'
run: go mod tidy
- name: Download dependencies
run: go mod download
- name: Build Linux
if: matrix.goos == 'linux'
run: go build -o VPDesktop
- name: Build Windows
if: matrix.goos == 'windows'
run: go build -ldflags="-H=windowsgui" -o VPDesktop.exe
shell: bash
- name: Build macOS
if: matrix.goos == 'darwin'
run: go build -o VPDesktop
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: vpdesktop-${{ matrix.goos }}
path: ${{ matrix.goos == 'windows' && 'VPDesktop.exe' || 'VPDesktop' }}