mirror of
https://github.com/amiayweb/Hytale-F2P.git
synced 2026-02-26 16:41:45 -03:00
88 lines
2.3 KiB
YAML
88 lines
2.3 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: '22'
|
|
cache: 'npm'
|
|
- run: npm ci
|
|
|
|
# ONLY RUNS ON LINUX: Required for pacman/bsdtar
|
|
- name: Install Linux build dependencies
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libarchive-tools
|
|
|
|
- name: Build for ${{ matrix.os }}
|
|
run: npm run build:${{ matrix.platform }}
|
|
|
|
- name: Upload Artifacts for ${{ matrix.os }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.os }}-builds
|
|
path: |
|
|
dist/*.exe
|
|
dist/*.exe.blockmap
|
|
dist/*.dmg
|
|
dist/*.zip
|
|
dist/*.AppImage
|
|
dist/*.AppImage.blockmap
|
|
dist/*.deb
|
|
dist/*.rpm
|
|
dist/*.pkg.tar.zst
|
|
dist/latest*.yml
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
- name: Display structure of downloaded files
|
|
run: ls -R artifacts
|
|
- name: Get version from package.json
|
|
id: pkg_version
|
|
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}.r{1}', steps.pkg_version.outputs.VERSION, github.run_number) }}
|
|
files: |
|
|
artifacts/ubuntu-latest-builds/**/*
|
|
artifacts/windows-latest-builds/**/*
|
|
artifacts/macos-latest-builds/**/*
|
|
generate_release_notes: true
|
|
draft: true
|
|
prerelease: false
|