mirror of
https://git.sanhost.net/sanasol/hytale-f2p.git
synced 2026-02-26 06:41:47 -03:00
Add GitHub Actions workflow for building and releasing artifacts across Linux, Windows, and macOS platforms
This commit is contained in:
82
.github/workflows/release.yml
vendored
82
.github/workflows/release.yml
vendored
@@ -9,64 +9,56 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-linux:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
platform: linux
|
|
||||||
- os: windows-latest
|
|
||||||
platform: win
|
|
||||||
- os: macos-latest
|
|
||||||
platform: mac
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: actions/setup-node@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '22'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
- name: Install dependencies
|
- run: npm run build:linux
|
||||||
run: npm ci
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Build for Linux
|
- uses: actions/upload-artifact@v4
|
||||||
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:
|
with:
|
||||||
name: linux-builds
|
name: linux-builds
|
||||||
path: |
|
path: |
|
||||||
dist/*.AppImage
|
dist/*.AppImage
|
||||||
dist/*.deb
|
dist/*.deb
|
||||||
|
|
||||||
- name: Upload Windows artifacts
|
build-windows:
|
||||||
if: matrix.platform == 'win'
|
runs-on: windows-latest
|
||||||
uses: actions/upload-artifact@v4
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build:win
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: windows-builds
|
name: windows-builds
|
||||||
path: |
|
path: |
|
||||||
dist/*.exe
|
dist/*.exe
|
||||||
|
|
||||||
- name: Upload macOS artifacts
|
build-macos:
|
||||||
if: matrix.platform == 'mac'
|
runs-on: macos-latest
|
||||||
uses: actions/upload-artifact@v4
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build:mac
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: macos-builds
|
name: macos-builds
|
||||||
path: |
|
path: |
|
||||||
@@ -75,7 +67,7 @@ jobs:
|
|||||||
dist/latest-mac.yml
|
dist/latest-mac.yml
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: [build-linux, build-windows, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user