mirror of
https://github.com/amiayweb/Hytale-F2P.git
synced 2026-02-26 06:01:45 -03:00
Add GitHub Actions workflow for building and releasing artifacts across Linux, Windows, and macOS platforms
This commit is contained in:
103
.github/workflows/release.yml
vendored
Normal file
103
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
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
|
||||
@@ -94,15 +94,13 @@
|
||||
{
|
||||
"target": "dmg",
|
||||
"arch": [
|
||||
"x64",
|
||||
"arm64"
|
||||
"universal"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "zip",
|
||||
"arch": [
|
||||
"x64",
|
||||
"arm64"
|
||||
"universal"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user