mirror of
https://github.com/Project-Babble/Baballonia.git
synced 2026-11-20 00:51:30 -08:00
- MainWindow: read AssemblyInformationalVersion (keeps -prerelease suffix), strip +<git-sha> - Baballonia.csproj: add Version default, disable source-revision suffix - build.yml: pass -p:Version from the workflow version-number input when set
278 lines
9.4 KiB
YAML
278 lines
9.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
publish-release:
|
|
description: 'Publish Release'
|
|
type: boolean
|
|
default: false
|
|
publish-pre-release:
|
|
description: 'Mark as Pre-Release'
|
|
type: boolean
|
|
default: false
|
|
version-number:
|
|
description: 'Version Number for Release'
|
|
type: string
|
|
release-name-info:
|
|
description: 'Additional info to put at the end of the release name'
|
|
type: string
|
|
required: false
|
|
release-notes:
|
|
description: 'Release notes, auto generated if not given'
|
|
type: string
|
|
required: false
|
|
publish-steam:
|
|
description: 'Publish on Steam'
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: ${{ matrix.name }}
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- { name: steamrt4-x64, result: Baballonia.x64.tar.xz, runs-on: ubuntu-22.04, upload-path: src/Baballonia.Desktop/bin/Baballonia.x64.tar.xz, arch: linux-x64, container: "registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk:latest" }
|
|
- { name: steamrt4-arm, result: Baballonia.arm64.tar.xz, runs-on: ubuntu-22.04-arm, upload-path: src/Baballonia.Desktop/bin/Baballonia.arm64.tar.xz, arch: linux-arm64, container: "registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk/arm64:latest" }
|
|
|
|
runs-on: ${{ matrix.runs-on }}
|
|
|
|
# Build inside the Steam Runtime 4 SDK so the artifact is produced against the
|
|
# steamrt4 (Debian 13 'trixie') ABI the app actually runs under at launch,
|
|
# rather than the host ubuntu image. steamrt4 deliberately omits ICU and ships
|
|
# libv4l2 only as libv4l2.so.0 — the app now carries app-local ICU and resolves
|
|
# V4L2 via libc, so the published self-contained build runs there unmodified.
|
|
container:
|
|
image: ${{ matrix.container }}
|
|
|
|
env:
|
|
# steamrt4 has no ICU, so the .NET *build* CLI can't initialise globalization
|
|
# in this container — run the build tooling invariant. This only affects the
|
|
# build process; the published app still ships its own ICU and sets
|
|
# System.Globalization.AppLocalIcu in its runtimeconfig (see Desktop.csproj).
|
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1'
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
|
|
DOTNET_NOLOGO: '1'
|
|
|
|
steps:
|
|
# git/curl/unzip are needed by checkout (submodules), the .NET installer, and
|
|
# download_dependencies.sh. Installed from the SDK's preconfigured apt repo.
|
|
- name: Install build prerequisites
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends git curl unzip xz-utils ca-certificates patchelf
|
|
|
|
- name: Checkout latest
|
|
uses: actions/checkout@v5
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Install .NET SDK
|
|
run: |
|
|
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
|
|
bash /tmp/dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet
|
|
echo "/usr/share/dotnet" >> "$GITHUB_PATH"
|
|
|
|
- name: Download dependencies
|
|
run: ./download_dependencies.sh
|
|
|
|
- name: Run publish
|
|
run: |
|
|
cd src/Baballonia.Desktop
|
|
version_arg=()
|
|
[ -n "${{ github.event.inputs.version-number }}" ] && version_arg=(-p:Version="${{ github.event.inputs.version-number }}")
|
|
dotnet publish -r ${{ matrix.arch }} -c Release --self-contained -f net10.0 "${version_arg[@]}"
|
|
cd "bin/Release/net10.0/${{ matrix.arch }}/publish"
|
|
tar -cJf ./../../../../${{ matrix.result }} *
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.result }}
|
|
path: ${{ matrix.upload-path }}
|
|
|
|
build-windows-x64:
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
|
- name: Checkout latest
|
|
uses: actions/checkout@v5
|
|
with:
|
|
submodules: 'recursive'
|
|
lfs: true
|
|
|
|
- name: Install NSIS
|
|
uses: negrutiu/nsis-install@v2
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Download dependencies
|
|
shell: pwsh
|
|
run: ./download_dependencies.ps1
|
|
|
|
- name: Build project
|
|
run: |
|
|
cd src/Baballonia.Desktop
|
|
version_arg=()
|
|
[ -n "${{ github.event.inputs.version-number }}" ] && version_arg=(-p:Version="${{ github.event.inputs.version-number }}")
|
|
dotnet publish -r win-x64 -c Release --self-contained -f net10.0 "${version_arg[@]}"
|
|
cd "bin/Release/net10.0/win-x64/publish"
|
|
tar -cJf ./../../../../Baballonia.win.tar.xz *
|
|
|
|
- name: Run makensis
|
|
run: |
|
|
cd src/Baballonia.Desktop
|
|
makensis -DWORKFLOW_VERSION="${{ github.event.inputs.version-number }}" main.nsi
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "Baballonia Setup.exe"
|
|
path: "src/Baballonia.Desktop/Baballonia Setup.exe"
|
|
|
|
- name: Upload tarball artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "Baballonia.win.tar.xz"
|
|
path: "src/Baballonia.Desktop/bin/Baballonia.win.tar.xz"
|
|
|
|
publish-release:
|
|
needs: [build-linux, build-windows-x64]
|
|
if: ${{ github.event.inputs.publish-release == 'true' }}
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Validate version number exists
|
|
run: |
|
|
if [ -z "${{ github.event.inputs.version-number }}" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
- name: Download Windows artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: "Baballonia Setup.exe"
|
|
path: ./artifacts
|
|
|
|
- name: Download Linux artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: Baballonia.x64.tar.xz
|
|
path: ./artifacts
|
|
|
|
- name: Download Linux ARM artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: Baballonia.arm64.tar.xz
|
|
path: ./artifacts
|
|
|
|
- name: Rename artifacts
|
|
env:
|
|
VERSION: ${{ github.event.inputs.version-number }}
|
|
run: |
|
|
cd artifacts
|
|
mv "Baballonia Setup.exe" "Baballonia.Setup.${VERSION}.exe"
|
|
mv "Baballonia.x64.tar.xz" "Baballonia.x64.${VERSION}.tar.xz"
|
|
mv "Baballonia.arm64.tar.xz" "Baballonia.arm64.${VERSION}.tar.xz"
|
|
|
|
- name: Set dynamic release name
|
|
id: release-name
|
|
run: |
|
|
if [[ -z "${{ github.event.inputs.release-name-info }}" ]]; then
|
|
echo "name=${{ github.event.inputs.version-number }}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "name=${{ github.event.inputs.version-number }} - ${{ github.event.inputs.release-name-info }}" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Set release body or generate notes
|
|
id: release-body
|
|
run: |
|
|
if [[ -z "${{ github.event.inputs.release-notes }}" ]]; then
|
|
echo "generate_notes=true" >> "$GITHUB_OUTPUT"
|
|
echo "body=" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "generate_notes=false" >> "$GITHUB_OUTPUT"
|
|
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
|
echo "${{ github.event.inputs.release-notes }}" >> "$GITHUB_OUTPUT"
|
|
echo "EOF" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Publish release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/Baballonia.Setup.${{ github.event.inputs.version-number }}.exe
|
|
artifacts/Baballonia.x64.${{ github.event.inputs.version-number }}.tar.xz
|
|
artifacts/Baballonia.arm64.${{ github.event.inputs.version-number }}.tar.xz
|
|
tag_name: ${{ github.event.inputs.version-number }}
|
|
name: ${{ steps.release-name.outputs.name }}
|
|
prerelease: ${{ github.event.inputs.publish-pre-release }}
|
|
body: ${{ steps.release-body.outputs.body }}
|
|
generate_release_notes: ${{ steps.release-body.outputs.generate_notes }}
|
|
|
|
publish-steam:
|
|
needs: [build-linux, build-windows-x64]
|
|
if: ${{ github.event.inputs.publish-steam == 'true' }}
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Validate version number exists
|
|
run: |
|
|
if [ -z "${{ github.event.inputs.version-number }}" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
- name: Download Windows artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: Baballonia.win.tar.xz
|
|
path: ./artifacts
|
|
|
|
- name: Download Linux artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: Baballonia.x64.tar.xz
|
|
path: ./artifacts
|
|
|
|
#- name: Download Linux ARM artifact
|
|
# uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: Baballonia.arm64.tar.xz
|
|
# path: ./artifacts
|
|
|
|
- name: Untar artifacts
|
|
run: |
|
|
mkdir -p ./builds/windows
|
|
mkdir -p ./builds/linux-x64
|
|
tar -xf ./artifacts/Baballonia.win.tar.xz --directory ./builds/windows
|
|
tar -xf ./artifacts/Baballonia.x64.tar.xz --directory ./builds/linux-x64
|
|
|
|
- name: Upload to Steam
|
|
uses: game-ci/steam-deploy@v3
|
|
with:
|
|
username: ${{ secrets.STEAM_USERNAME }}
|
|
configVdf: ${{ secrets.STEAM_CONFIG_VDF }}
|
|
appId: 4091970
|
|
buildDescription: ${{ github.event.inputs.version-number }}
|
|
depot2Path: builds/windows
|
|
depot3Path: builds/linux-x64
|
|
releaseBranch: prerelease
|