GitHub Actions: update workflows and add Linux arm64 support for .NET
This commit is contained in:
parent
83832a6724
commit
4d01b1f804
7 changed files with 62 additions and 37 deletions
63
.github/workflows/dotnet.yml
vendored
63
.github/workflows/dotnet.yml
vendored
|
|
@ -2,15 +2,15 @@ name: .NET
|
|||
on: push
|
||||
|
||||
jobs:
|
||||
Linux_Native:
|
||||
runs-on: ubuntu-latest
|
||||
Linux_amd64:
|
||||
runs-on: ubuntu-24.04
|
||||
container:
|
||||
image: almalinux:8
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
steps:
|
||||
- name: Cloning
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Install packages
|
||||
run: dnf install -y cmake gcc gcc-c++
|
||||
- name: Configure CMake
|
||||
|
|
@ -20,11 +20,33 @@ jobs:
|
|||
- name: Install
|
||||
run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/"
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: AlmaLinux amd64
|
||||
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
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
|
@ -36,7 +58,7 @@ jobs:
|
|||
- amd64_arm64
|
||||
steps:
|
||||
- name: Cloning
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
|
|
@ -48,12 +70,12 @@ jobs:
|
|||
- name: Install
|
||||
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: Windows MSVC ${{matrix.arch}}
|
||||
path: ${{github.workspace}}/install/
|
||||
Release:
|
||||
needs: [Linux_Native, Windows_Native]
|
||||
needs: [Linux_amd64, Linux_arm64, Windows]
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
|
|
@ -62,33 +84,40 @@ jobs:
|
|||
BUILD_TYPE: Release
|
||||
steps:
|
||||
- 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
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: AlmaLinux amd64
|
||||
path: assets/linux-x64
|
||||
- name: Download Windows MSVC amd64 Assets
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: Windows MSVC amd64
|
||||
path: assets/win-x64
|
||||
- name: Download Windows MSVC amd64_x86 Assets
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Download Windows MSVC x86 Assets
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: Windows MSVC amd64_x86
|
||||
path: assets/win-x86
|
||||
- name: Download Windows MSVC amd64_arm64 Assets
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Download Windows MSVC arm64 Assets
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: Windows MSVC amd64_arm64
|
||||
path: assets/win-arm64
|
||||
- name: Copy Assets
|
||||
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\win-arm64\native"
|
||||
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x64\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\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"
|
||||
|
|
@ -96,13 +125,13 @@ jobs:
|
|||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Build RagePhoto.Core
|
||||
run: msbuild "${{github.workspace}}\src\dotnet\RagePhoto.Core.csproj" /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}}
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: NuGet Package
|
||||
path: ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\RagePhoto.Core.*.nupkg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue