Skip to content

More changes

More changes #20

Workflow file for this run

name: Build Project
on:
workflow_dispatch:
push:
branches:
- ui
# - main
env:
PROJECT_PATH: ./Source/HedgeModManager.UI/HedgeModManager.UI.csproj
FLATPAK_ID: io.github.hedge_dev.hedgemodmanager
GENERATOR_URL: https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/refs/heads/master/dotnet/flatpak-dotnet-generator.py
DOTNET_VERSION: 8
DOTNET_CLI_HOME: /tmp/.dotnet
FREEDESKTOP_VERSION: 24.08
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rid: [linux-x64, win-x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore packages
run: dotnet restore ${{env.PROJECT_PATH}}
- name: ${{matrix.rid}} Build
run: dotnet publish -p:PublishProfile=${{matrix.rid}} -c Release -o ./output/${{matrix.rid}} ${{env.PROJECT_PATH}}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: HedgeModManager-${{matrix.rid}}
path: ./output/${{matrix.rid}}
build-flatpak:
name: Build Flatpak
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged
strategy:
matrix:
arch: [x86_64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies from Flathub
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub org.freedesktop.Sdk//${{env.FREEDESKTOP_VERSION}}
flatpak install -y flathub org.freedesktop.Sdk.Extension.dotnet${{env.DOTNET_VERSION}}//${{env.FREEDESKTOP_VERSION}}
- name: Generate NuGet sources
run: |
curl -o flatpak-dotnet-generator.py ${{env.GENERATOR_URL}}
chmod +x flatpak-dotnet-generator.py
python3 flatpak-dotnet-generator.py ./flatpak/nuget-sources.json ${{env.PROJECT_PATH}} --dotnet ${{env.DOTNET_VERSION}} --freedesktop ${{env.FREEDESKTOP_VERSION}}
- name: Build flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
bundle: ${{env.FLATPAK_ID}}.flatpak
manifest-path: ./flatpak/${{env.FLATPAK_ID}}.yml
cache-key: flatpak-builder-${{github.sha}}
arch: ${{matrix.arch}}
upload-artifact: false
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: HedgeModManager-flatpak-${{matrix.arch}}
path: ./${{env.FLATPAK_ID}}.flatpak
- name: Upload nuget-sources.json
uses: actions/upload-artifact@v4
with:
name: nuget-sources.json
path: ./flatpak/nuget-sources.json