GitHub Actions: update workflows and add Linux arm64 support for .NET

This commit is contained in:
Syping 2025-10-24 21:05:30 +02:00
parent 83832a6724
commit 4d01b1f804
7 changed files with 62 additions and 37 deletions

View file

@ -2,15 +2,15 @@ name: .NET
on: push on: push
jobs: jobs:
Linux_Native: Linux_amd64:
runs-on: ubuntu-latest runs-on: ubuntu-24.04
container: container:
image: almalinux:8 image: almalinux:8
env: env:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Install packages - name: Install packages
run: dnf install -y cmake gcc gcc-c++ run: dnf install -y cmake gcc gcc-c++
- name: Configure CMake - name: Configure CMake
@ -20,11 +20,33 @@ jobs:
- name: Install - name: Install
run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/" run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: AlmaLinux amd64 name: AlmaLinux amd64
path: ${{github.workspace}}/install/ path: ${{github.workspace}}/install/
Windows_Native: Linux_arm64:
runs-on: ubuntu-24.04-arm
container:
image: almalinux:8
env:
BUILD_TYPE: Release
steps:
- name: Cloning
uses: actions/checkout@v5
- name: Install packages
run: dnf install -y cmake gcc gcc-c++
- name: Configure CMake
run: cmake -B "build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build "build" --config ${{env.BUILD_TYPE}}
- name: Install
run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/"
- name: Upload
uses: actions/upload-artifact@v5
with:
name: AlmaLinux arm64
path: ${{github.workspace}}/install/
Windows:
runs-on: windows-latest runs-on: windows-latest
env: env:
BUILD_TYPE: Release BUILD_TYPE: Release
@ -36,7 +58,7 @@ jobs:
- amd64_arm64 - amd64_arm64
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Setup MSVC - name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
@ -48,12 +70,12 @@ jobs:
- name: Install - name: Install
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Windows MSVC ${{matrix.arch}} name: Windows MSVC ${{matrix.arch}}
path: ${{github.workspace}}/install/ path: ${{github.workspace}}/install/
Release: Release:
needs: [Linux_Native, Windows_Native] needs: [Linux_amd64, Linux_arm64, Windows]
runs-on: windows-latest runs-on: windows-latest
defaults: defaults:
run: run:
@ -62,33 +84,40 @@ jobs:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Download Linux arm64 Assets
uses: actions/download-artifact@v6
with:
name: AlmaLinux arm64
path: assets/linux-arm64
- name: Download Linux amd64 Assets - name: Download Linux amd64 Assets
uses: actions/download-artifact@v4 uses: actions/download-artifact@v6
with: with:
name: AlmaLinux amd64 name: AlmaLinux amd64
path: assets/linux-x64 path: assets/linux-x64
- name: Download Windows MSVC amd64 Assets - name: Download Windows MSVC amd64 Assets
uses: actions/download-artifact@v4 uses: actions/download-artifact@v6
with: with:
name: Windows MSVC amd64 name: Windows MSVC amd64
path: assets/win-x64 path: assets/win-x64
- name: Download Windows MSVC amd64_x86 Assets - name: Download Windows MSVC x86 Assets
uses: actions/download-artifact@v4 uses: actions/download-artifact@v6
with: with:
name: Windows MSVC amd64_x86 name: Windows MSVC amd64_x86
path: assets/win-x86 path: assets/win-x86
- name: Download Windows MSVC amd64_arm64 Assets - name: Download Windows MSVC arm64 Assets
uses: actions/download-artifact@v4 uses: actions/download-artifact@v6
with: with:
name: Windows MSVC amd64_arm64 name: Windows MSVC amd64_arm64
path: assets/win-arm64 path: assets/win-arm64
- name: Copy Assets - name: Copy Assets
run: | run: |
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\linux-arm64\native"
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native" mkdir -p "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native"
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native" mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native"
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x64\native" mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x64\native"
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x86\native" mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x86\native"
cp "${{github.workspace}}\assets\linux-arm64\lib64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-arm64\native\libragephoto.so"
cp "${{github.workspace}}\assets\linux-x64\lib64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native\libragephoto.so" cp "${{github.workspace}}\assets\linux-x64\lib64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native\libragephoto.so"
cp "${{github.workspace}}\assets\win-arm64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll" cp "${{github.workspace}}\assets\win-arm64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll"
cp "${{github.workspace}}\assets\win-x64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll" cp "${{github.workspace}}\assets\win-x64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll"
@ -96,13 +125,13 @@ jobs:
- name: Setup MSBuild - name: Setup MSBuild
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v2
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v5
with: with:
dotnet-version: 8.0.x dotnet-version: 8.0.x
- name: Build RagePhoto.Core - name: Build RagePhoto.Core
run: msbuild "${{github.workspace}}\src\dotnet\RagePhoto.Core.csproj" /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}} run: msbuild "${{github.workspace}}\src\dotnet\RagePhoto.Core.csproj" /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}}
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: NuGet Package name: NuGet Package
path: ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\RagePhoto.Core.*.nupkg path: ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\RagePhoto.Core.*.nupkg

View file

@ -8,7 +8,7 @@ jobs:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Install packages - name: Install packages
run: | run: |
sudo apt-get update -qq sudo apt-get update -qq
@ -20,8 +20,7 @@ jobs:
- name: Install - name: Install
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local" run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Ubuntu name: Ubuntu
path: | path: ${{github.workspace}}/install/
${{github.workspace}}/install/

View file

@ -13,7 +13,7 @@ jobs:
- 17 - 17
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Install packages - name: Install packages
run: | run: |
sudo apt-get update -qq sudo apt-get update -qq
@ -25,8 +25,7 @@ jobs:
- name: Install - name: Install
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local" run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Ubuntu C++${{matrix.cxxstd}} name: Ubuntu C++${{matrix.cxxstd}}
path: | path: ${{github.workspace}}/install/
${{github.workspace}}/install/

View file

@ -8,7 +8,7 @@ jobs:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14 uses: mymindstorm/setup-emsdk@v14
with: with:
@ -22,7 +22,7 @@ jobs:
- name: Build - name: Build
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: WebAssembly name: WebAssembly
path: | path: |

View file

@ -8,7 +8,7 @@ jobs:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14 uses: mymindstorm/setup-emsdk@v14
with: with:
@ -22,7 +22,7 @@ jobs:
- name: Build - name: Build
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: WebAssembly name: WebAssembly
path: | path: |

View file

@ -14,7 +14,7 @@ jobs:
- amd64_arm64 - amd64_arm64
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Setup MSVC - name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
@ -26,8 +26,7 @@ jobs:
- name: Install - name: Install
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Windows MSVC ${{matrix.arch}} name: Windows MSVC ${{matrix.arch}}
path: | path: ${{github.workspace}}/install/
${{github.workspace}}/install/

View file

@ -17,7 +17,7 @@ jobs:
- 17 - 17
steps: steps:
- name: Cloning - name: Cloning
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Setup MSVC - name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
@ -29,8 +29,7 @@ jobs:
- name: Install - name: Install
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload - name: Upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Windows MSVC C++${{matrix.cxxstd}} ${{matrix.arch}} name: Windows MSVC C++${{matrix.cxxstd}} ${{matrix.arch}}
path: | path: ${{github.workspace}}/install/
${{github.workspace}}/install/