184 lines
5.2 KiB
YAML
184 lines
5.2 KiB
YAML
name: Build Client for All Platforms
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
paths:
|
|
- 'Client/**'
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'Client/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
cache: 'npm'
|
|
cache-dependency-path: Client/package-lock.json
|
|
|
|
- name: Install system dependencies (Ubuntu)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libnss3-dev libatk-bridge2.0-dev libdrm2 libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev libgbm-dev libxss1 libasound2-dev
|
|
|
|
- name: Install system dependencies (macOS)
|
|
if: matrix.os == 'macos-latest'
|
|
run: |
|
|
# Install Xcode command line tools if not present
|
|
xcode-select --install 2>/dev/null || true
|
|
|
|
- name: Install system dependencies (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
# Windows builds typically have required dependencies pre-installed
|
|
# Ensure chocolatey is available for any additional packages
|
|
choco --version || echo "Chocolatey not available"
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./Client
|
|
run: |
|
|
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
npm ci --include=dev
|
|
else
|
|
npm ci
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Clean previous builds
|
|
working-directory: ./Client
|
|
run: |
|
|
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
if exist dist rmdir /s /q dist
|
|
else
|
|
rm -rf dist
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Build for ${{ matrix.os }}
|
|
working-directory: ./Client
|
|
run: |
|
|
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
|
|
npm run build-linux
|
|
elif [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
npm run build-win
|
|
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
|
|
npm run build-mac
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: client-${{ matrix.os }}
|
|
path: Client/dist/
|
|
retention-days: 30
|
|
continue-on-error: true
|
|
|
|
package:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Create release directory
|
|
run: mkdir -p release
|
|
|
|
- name: Organize files by platform
|
|
run: |
|
|
# Windows files
|
|
mkdir -p release/Windows
|
|
if [ -d "artifacts/client-windows-latest" ]; then
|
|
cp -r artifacts/client-windows-latest/* release/Windows/ || true
|
|
fi
|
|
|
|
# macOS files
|
|
mkdir -p release/macOS
|
|
if [ -d "artifacts/client-macos-latest" ]; then
|
|
cp -r artifacts/client-macos-latest/* release/macOS/ || true
|
|
fi
|
|
|
|
# Linux files
|
|
mkdir -p release/Linux
|
|
if [ -d "artifacts/client-ubuntu-latest" ]; then
|
|
cp -r artifacts/client-ubuntu-latest/* release/Linux/ || true
|
|
fi
|
|
|
|
# List what we actually got
|
|
echo "=== Build Results ==="
|
|
find release -type f -name "*" | head -20 || true
|
|
|
|
# Create platform info file
|
|
cat > release/PLATFORMS.txt << EOF
|
|
Galaxy Strike Online - Multi-Platform Client
|
|
==========================================
|
|
|
|
Windows:
|
|
- NSIS Installer (.exe)
|
|
- Portable executable (.exe)
|
|
|
|
macOS:
|
|
- DMG disk image
|
|
- ZIP archive
|
|
|
|
Linux:
|
|
- AppImage (universal executable)
|
|
- Debian package (.deb)
|
|
|
|
Build Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
|
|
Commit: ${{ github.sha }}
|
|
EOF
|
|
|
|
- name: Create all-in-one zip
|
|
run: |
|
|
cd release
|
|
zip -r ../Galaxy-Strike-Online-Client-${{ github.sha }}.zip .
|
|
|
|
- name: Upload all-in-one zip
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: galaxy-strike-online-client-all-platforms
|
|
path: Galaxy-Strike-Online-Client-${{ github.sha }}.zip
|
|
retention-days: 90
|
|
|
|
- name: Create Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: Galaxy-Strike-Online-Client-${{ github.sha }}.zip
|
|
name: Galaxy Strike Online Client - ${{ github.ref_name }}
|
|
body: |
|
|
Multi-platform client release for Galaxy Strike Online.
|
|
|
|
Includes:
|
|
- Windows (NSIS installer + Portable)
|
|
- macOS (DMG + ZIP)
|
|
- Linux (AppImage + Debian package)
|
|
|
|
Commit: ${{ github.sha }}
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|