Skip to content

.github/workflows/build.yml #224

.github/workflows/build.yml

.github/workflows/build.yml #224

Workflow file for this run

on:
push:
branches:
- main
- dev
- release/*
workflow_dispatch:
jobs:
build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows, os: windows-2022, shell: bash, artifact: 'pengu-windows' }
- { name: MacOS, os: macos-12, shell: sh, artifact: 'pengu-macos' }
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Prepare environment variables
run: |
echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV
echo "APP_VERSION=`cat loader/Version.cs | grep -o '[0-9].[0-9].[0-9]'`" >> $GITHUB_ENV
- name: Setup MSBuild
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Build preload plugins
run: |
cd plugins
pnpm install
pnpm build
- name: Build solution
if: runner.os == 'Windows'
run: msbuild.exe pengu.sln -t:build -p:Configuration=Release -p:Platform=x64
- name: Build makefile
if: runner.os == 'macOS'
run: make release
- name: Upload build outputs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.artifact }}-v${{ env.APP_VERSION }}-dev-${{ env.SHORT_SHA }}
path: |
bin/
!bin/obj/