mirror of
https://git.sanhost.net/sanasol/hytale-f2p.git
synced 2026-02-26 06:41:47 -03:00
104 lines
2.2 KiB
YAML
104 lines
2.2 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
- os: windows-latest
|
|
platform: win
|
|
- os: macos-latest
|
|
platform: mac
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build for Linux
|
|
if: matrix.platform == 'linux'
|
|
run: npm run build:linux
|
|
|
|
- name: Build for Windows
|
|
if: matrix.platform == 'win'
|
|
run: npm run build:win
|
|
|
|
- name: Build for macOS (Universal)
|
|
if: matrix.platform == 'mac'
|
|
run: npm run build:mac
|
|
|
|
- name: Upload Linux artifacts
|
|
if: matrix.platform == 'linux'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-builds
|
|
path: |
|
|
dist/*.AppImage
|
|
dist/*.deb
|
|
|
|
- name: Upload Windows artifacts
|
|
if: matrix.platform == 'win'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-builds
|
|
path: |
|
|
dist/*.exe
|
|
|
|
- name: Upload macOS artifacts
|
|
if: matrix.platform == 'mac'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-builds
|
|
path: |
|
|
dist/*.dmg
|
|
dist/*.zip
|
|
dist/latest-mac.yml
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Display structure of downloaded files
|
|
run: ls -R artifacts
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/linux-builds/*
|
|
artifacts/windows-builds/*
|
|
artifacts/macos-builds/*
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: false
|