164 lines
6.3 KiB
YAML
164 lines
6.3 KiB
YAML
name: .NET
|
|
on: push
|
|
env:
|
|
BUILD_TYPE: Release
|
|
OSX_DEPLOYMENT_TARGET: "11.0"
|
|
|
|
jobs:
|
|
Linux:
|
|
runs-on: ${{matrix.runner}}
|
|
container:
|
|
image: almalinux:8
|
|
strategy:
|
|
matrix:
|
|
arch: [arm64, x64]
|
|
include:
|
|
- arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
- arch: x64
|
|
runner: ubuntu-24.04
|
|
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 -DRAGEPHOTO_EXTRACT=OFF -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: Linux ${{matrix.arch}}
|
|
path: ${{github.workspace}}/install/lib64/libragephoto.so
|
|
macOS:
|
|
runs-on: ${{matrix.runner}}
|
|
env:
|
|
BUILD_TYPE: Release
|
|
strategy:
|
|
matrix:
|
|
arch: [arm64, x64]
|
|
include:
|
|
- arch: arm64
|
|
runner: macos-15
|
|
- arch: x64
|
|
runner: macos-15-intel
|
|
steps:
|
|
- name: Cloning
|
|
uses: actions/checkout@v5
|
|
- name: Configure CMake
|
|
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_DEPLOYMENT_TARGET}} -GNinja
|
|
- name: Build
|
|
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
|
|
- name: Install
|
|
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/"
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: macOS ${{matrix.arch}}
|
|
path: ${{github.workspace}}/install/lib/libragephoto.dylib
|
|
Windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [arm64, x64, x86]
|
|
include:
|
|
- arch: arm64
|
|
msvc: amd64_arm64
|
|
- arch: x64
|
|
msvc: amd64
|
|
- arch: x86
|
|
msvc: amd64_x86
|
|
steps:
|
|
- name: Cloning
|
|
uses: actions/checkout@v5
|
|
- name: Setup MSVC
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: ${{matrix.msvc}}
|
|
- name: Configure CMake
|
|
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
|
|
- name: Build
|
|
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
|
|
- name: Install
|
|
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: Windows MSVC ${{matrix.arch}}
|
|
path: ${{github.workspace}}/install/bin/libragephoto.dll
|
|
Release:
|
|
needs: [Linux, macOS, Windows]
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
shell: pwsh
|
|
steps:
|
|
- name: Cloning
|
|
uses: actions/checkout@v5
|
|
- name: Download Linux arm64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: Linux arm64
|
|
path: assets/linux-arm64
|
|
- name: Download Linux x64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: Linux x64
|
|
path: assets/linux-x64
|
|
- name: Download macOS arm64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: macOS arm64
|
|
path: assets/osx-arm64
|
|
- name: Download macOS x64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: macOS x64
|
|
path: assets/osx-x64
|
|
- name: Download Windows arm64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: Windows MSVC arm64
|
|
path: assets/win-arm64
|
|
- name: Download Windows x64 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: Windows MSVC x64
|
|
path: assets/win-x64
|
|
- name: Download Windows x86 Assets
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
name: Windows MSVC x86
|
|
path: assets/win-x86
|
|
- 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\osx-arm64\native"
|
|
mkdir -p "${{github.workspace}}\src\dotnet\runtimes\osx-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\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-arm64\native\libragephoto.so"
|
|
cp "${{github.workspace}}\assets\linux-x64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native\libragephoto.so"
|
|
cp "${{github.workspace}}\assets\osx-arm64\libragephoto.dylib" "${{github.workspace}}\src\dotnet\runtimes\osx-arm64\native\libragephoto.dylib"
|
|
cp "${{github.workspace}}\assets\osx-x64\libragephoto.dylib" "${{github.workspace}}\src\dotnet\runtimes\osx-x64\native\libragephoto.dylib"
|
|
cp "${{github.workspace}}\assets\win-arm64\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll"
|
|
cp "${{github.workspace}}\assets\win-x64\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll"
|
|
cp "${{github.workspace}}\assets\win-x86\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x86\native\libragephoto.dll"
|
|
- name: Setup MSBuild
|
|
uses: microsoft/setup-msbuild@v2
|
|
- name: Setup .NET
|
|
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@v5
|
|
with:
|
|
name: NuGet Package
|
|
path: ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\RagePhoto.Core.*.nupkg
|