This repository has been archived on 2026-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
Galaxy-Strike-Online/.github/workflows/build-client.yml
2026-01-24 16:53:26 -04:00

153 lines
4.1 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 dependencies
working-directory: ./Client
run: npm ci
- name: Clean previous builds
working-directory: ./Client
run: rm -rf dist || true
- 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 }}