From 333966caffe0b80bb0f0ef321801f71e6d6360f0 Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:37:23 +1100 Subject: [PATCH] Added GitHub workflow --- .github/workflows/build.yml | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1a348da --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,71 @@ +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 + +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 -r ${{matrix.rid}} -c Release -o ./output/${{matrix.rid}} ${{env.PROJECT_PATH}} + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + 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: Build Flatpak + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + 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 \ No newline at end of file