138 lines
3.7 KiB
YAML
138 lines
3.7 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: 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
|
|
|
|
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
|
|
cp -r artifacts/client-windows-latest/* release/Windows/ 2>/dev/null || true
|
|
|
|
# macOS files
|
|
mkdir -p release/macOS
|
|
cp -r artifacts/client-macos-latest/* release/macOS/ 2>/dev/null || true
|
|
|
|
# Linux files
|
|
mkdir -p release/Linux
|
|
cp -r artifacts/client-ubuntu-latest/* release/Linux/ 2>/dev/null || 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 }}
|