Files
AstralRinth/.github/workflows/astralrinth-build.yml
T
didirus 24d082e6a6
AstralRinth App Build / 🐧 Linux Build (push) Has been cancelled
AstralRinth App Build / 🍎 macOS Build (push) Has been cancelled
AstralRinth App Build / 🪟 Windows Build (push) Has been cancelled
ci: remove unused upstream workflows and enable macOS build
2026-06-17 02:33:11 +03:00

171 lines
4.5 KiB
YAML

name: AstralRinth App Build
on:
push:
branches:
- main
- master
- prod
- release
- beta
- feature*
tags:
- release-*
- beta-*
paths:
- .github/workflows/astralrinth-build.yml
- 'apps/app/**'
- 'apps/app-frontend/**'
- 'packages/app-lib/**'
- 'packages/app-macros/**'
- 'packages/assets/**'
- 'packages/ui/**'
- 'packages/utils/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'turbo.jsonc'
- 'mise.toml'
- 'rust-toolchain.toml'
workflow_dispatch:
concurrency:
group: astralrinth-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.label }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
label: 🐧 Linux Build
artifact_name: astralrinth-bundle-linux
- runner: windows-latest
label: 🪟 Windows Build
artifact_name: astralrinth-bundle-windows
- runner: macos-latest
label: 🍎 macOS Build
artifact_name: astralrinth-bundle-macos
env:
CI: true
steps:
- name: 📥 Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: 🔍 Validate Git config does not introduce CRLF
shell: bash
run: |
echo "🔍 Checking Git config for CRLF settings..."
autocrlf=$(git config --get core.autocrlf || echo "unset")
eol_setting=$(git config --get core.eol || echo "unset")
echo "core.autocrlf = $autocrlf"
echo "core.eol = $eol_setting"
if [ "$autocrlf" = "true" ]; then
echo "⚠️ WARNING: core.autocrlf is set to 'true'. Consider setting it to 'input' or 'false'."
fi
if [ "$eol_setting" = "crlf" ]; then
echo "⚠️ WARNING: core.eol is set to 'crlf'. Consider unsetting it or setting it to 'lf'."
fi
- name: 🔍 Check migration files line endings (LF only)
shell: bash
run: |
echo "🔍 Scanning migration SQL files for CR characters (\\r)..."
if grep -Iq $'\r' packages/app-lib/migrations/*.sql; then
echo "❌ ERROR: Some migration files contain CR characters; expected LF-only files."
exit 1
fi
echo "✅ All migration files use LF line endings."
- name: 🧰 Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: ☕ Setup Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: 🧰 Setup pnpm
uses: pnpm/action-setup@v4
- name: 🧰 Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: 🧰 Setup mise
uses: jdx/mise-action@v2
with:
install: true
cache: true
- name: 🦀 Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
cache-on-failure: true
- name: 💨 Setup Turbo cache
uses: rharkor/caching-for-turbo@v1.8
- name: 🐧 Install Linux build dependencies
if: matrix.runner == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -yq \
build-essential \
curl \
file \
libayatana-appindicator3-dev \
libgtk-3-dev \
librsvg2-dev \
libssl-dev \
libwebkit2gtk-4.1-dev \
patchelf \
xdg-utils
- name: ⚙️ Set application environment
shell: bash
run: cp packages/app-lib/.env.prod packages/app-lib/.env
- name: 📦 Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: 🧹 Clean previous bundles
shell: bash
run: |
rm -rf target/release/bundle
rm -rf target/*/release/bundle || true
- name: 🔨 Build app
shell: bash
run: mise exec -- pnpm app:build
- name: 📤 Upload app bundles
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
target/release/bundle/**
target/*/release/bundle/**
if-no-files-found: error