Skip to content

Commit 70322dc

Browse files
Added aarch64 auto building
1 parent 4d7dc6e commit 70322dc

4 files changed

Lines changed: 42 additions & 18 deletions

File tree

.github/workflows/build-project.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ env:
1818
jobs:
1919
build:
2020
name: Build Project
21-
runs-on: ubuntu-24.04
21+
runs-on: ubuntu-26.04
2222
strategy:
2323
matrix:
24-
rid: [linux-x64, win-x64]
24+
rid: [linux-x64, linux-arm64, win-x64]
2525

2626
steps:
2727
- name: Checkout Repository
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v6
2929
with:
3030
fetch-depth: 0
3131

3232
- name: Setup .NET ${{ env.DOTNET_VERSION }} SDK
33-
uses: actions/setup-dotnet@v4
33+
uses: actions/setup-dotnet@v5
3434
with:
3535
dotnet-version: ${{ env.DOTNET_VERSION }}.0.x
3636

3737
- name: Setup .NET ${{ env.DOTNET_VERSION }} Cache
38-
uses: actions/cache@v4
38+
uses: actions/cache@v5
3939
with:
4040
path: ${{ env.DOTNET_CLI_HOME }}
4141
key: dotnet-${{ env.DOTNET_VERSION }}-${{ matrix.rid }}
@@ -49,18 +49,25 @@ jobs:
4949
run: dotnet publish -p:DefineConstants=COMMITBUILD -p:PublishProfile=${{ matrix.rid }} -c Release -o ./output/${{ matrix.rid }} ${{ env.PROJECT_PATH }}
5050

5151
- name: Upload Artifact
52-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@v7
5353
with:
5454
name: HedgeModManager-${{matrix.rid}}
5555
path: ./output/${{matrix.rid}}
5656

5757
build-flatpak:
5858
name: Build Flatpak
59-
runs-on: ubuntu-24.04
59+
strategy:
60+
matrix:
61+
include:
62+
- arch: x86_64
63+
runner: ubuntu-26.04
64+
- arch: aarch64
65+
runner: ubuntu-26.04-arm
66+
runs-on: ${{ matrix.runner }}
6067

6168
steps:
6269
- name: Checkout Repository
63-
uses: actions/checkout@v4
70+
uses: actions/checkout@v6
6471
with:
6572
fetch-depth: 0
6673

@@ -70,10 +77,10 @@ jobs:
7077
sudo apt-get install flatpak-builder -y
7178
7279
- name: Setup Flatpak Cache
73-
uses: actions/cache@v4
80+
uses: actions/cache@v5
7481
with:
7582
path: ~/.local/share/flatpak/runtime/
76-
key: flatpak-${{ env.FREEDESKTOP_VERSION }}-x86_64
83+
key: flatpak-${{ env.FREEDESKTOP_VERSION }}-${{ matrix.arch }}
7784

7885
- name: Setup Flatpak
7986
run: |
@@ -88,19 +95,20 @@ jobs:
8895
python3 flatpak-dotnet-generator.py ./flatpak/nuget-sources.json ${{env.PROJECT_PATH}} --dotnet ${{env.DOTNET_VERSION}} --freedesktop ${{env.FREEDESKTOP_VERSION}}
8996
9097
- name: Build Flatpak
91-
run: flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo builddir ./flatpak/${{ env.FLATPAK_ID }}-autobuild.yml
98+
run: flatpak-builder --user --arch=${{ matrix.arch }} --force-clean --install-deps-from=flathub --repo=repo builddir ./flatpak/${{ env.FLATPAK_ID }}-autobuild.yml
9299

93100
- name: Build Flatpak Bundle
94-
run: flatpak build-bundle repo ./flatpak/${{env.FLATPAK_ID}}.flatpak ${{env.FLATPAK_ID}}
101+
run: flatpak build-bundle --arch=${{ matrix.arch }} repo ./flatpak/${{env.FLATPAK_ID}}-${{ matrix.arch }}.flatpak ${{env.FLATPAK_ID}}
95102

96103
- name: Upload Flatpak Bundle
97-
uses: actions/upload-artifact@v4
104+
uses: actions/upload-artifact@v7
98105
with:
99-
name: HedgeModManager-flatpak-x86_64
100-
path: ./flatpak/${{env.FLATPAK_ID}}.flatpak
106+
name: HedgeModManager-flatpak-${{ matrix.arch }}
107+
path: ./flatpak/${{env.FLATPAK_ID}}-${{ matrix.arch }}.flatpak
101108

102109
- name: Upload NuGet Sources
103-
uses: actions/upload-artifact@v4
110+
if: matrix.arch == 'x86_64'
111+
uses: actions/upload-artifact@v7
104112
with:
105113
name: nuget-sources.json
106114
path: ./flatpak/nuget-sources.json
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
4+
<SelfContained>false</SelfContained>
5+
</PropertyGroup>
6+
</Project>

flatpak/flathub.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"only-arches": ["x86_64"]
2+
"only-arches": ["x86_64", "aarch64"]
33
}

flatpak/io.github.hedge_dev.hedgemodmanager-autobuild.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,22 @@ modules:
4242
- /usr/lib/sdk/dotnet8/bin/install.sh
4343
- name: hedge-mod-manager
4444
buildsystem: simple
45+
build-options:
46+
env:
47+
PUBLISH_PROFILE: linux-x86_64
48+
arch:
49+
x86_64:
50+
env:
51+
PUBLISH_PROFILE: linux-x86_64
52+
aarch64:
53+
env:
54+
PUBLISH_PROFILE: linux-arm
4555
sources:
4656
- type: dir
4757
path: ../
4858
- ./nuget-sources.json
4959
build-commands:
50-
- dotnet publish Source/HedgeModManager.UI/HedgeModManager.UI.csproj -c Release -p:DefineConstants=COMMITBUILD --no-self-contained --source ./nuget-sources
60+
- dotnet publish Source/HedgeModManager.UI/HedgeModManager.UI.csproj -c Release -p:DefineConstants=COMMITBUILD -p:PublishProfile=${PUBLISH_PROFILE} --no-self-contained --source ./nuget-sources
5161
- mkdir -p ${FLATPAK_DEST}/bin
5262
- cp -r Source/HedgeModManager.UI/bin/Release/net8.0/publish/* ${FLATPAK_DEST}/bin
5363
- install -Dm644 flatpak/hedgemodmanager.png ${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png

0 commit comments

Comments
 (0)