From 02ad50b373dbdb68b05628e35a2cd1edbc3b4e48 Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 9 Nov 2025 12:15:20 +0100 Subject: [PATCH 1/4] GitHub Actions: simplify .NET workflow artifact management --- .github/workflows/dotnet.yml | 49 +++++++++++------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2202f2f..9285e15 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -92,63 +92,44 @@ jobs: 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 + - name: Download Linux arm64 Artifacts uses: actions/download-artifact@v6 with: name: Linux arm64 - path: assets/linux-arm64 - - name: Download Linux x64 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/linux-arm64 + - name: Download Linux x64 Artifacts uses: actions/download-artifact@v6 with: name: Linux x64 - path: assets/linux-x64 - - name: Download macOS arm64 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/linux-x64 + - name: Download macOS arm64 Artifacts uses: actions/download-artifact@v6 with: name: macOS arm64 - path: assets/osx-arm64 - - name: Download macOS x64 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/osx-arm64 + - name: Download macOS x64 Artifacts uses: actions/download-artifact@v6 with: name: macOS x64 - path: assets/osx-x64 - - name: Download Windows arm64 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/osx-x64 + - name: Download Windows arm64 Artifacts uses: actions/download-artifact@v6 with: name: Windows MSVC arm64 - path: assets/win-arm64 - - name: Download Windows x64 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/win-arm64 + - name: Download Windows x64 Artifacts uses: actions/download-artifact@v6 with: name: Windows MSVC x64 - path: assets/win-x64 - - name: Download Windows x86 Assets + path: ${{github.workspace}}/src/dotnet/runtimes/win-x64 + - name: Download Windows x86 Artifacts 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" + path: ${{github.workspace}}/src/dotnet/runtimes/win-x86 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Setup .NET @@ -161,4 +142,4 @@ jobs: uses: actions/upload-artifact@v5 with: 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 From 926a49033c89983824186e45dbd859283bd85f0b Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 9 Nov 2025 13:34:12 +0100 Subject: [PATCH 2/4] GitHub Actions: add static build to .NET workflow --- .github/workflows/dotnet.yml | 59 ++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9285e15..ea30f3c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,16 +23,28 @@ jobs: - 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}} + run: | + cmake -B "build/shared" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cmake -B "build/static" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DRAGEPHOTO_STATIC=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build - run: cmake --build "build" --config ${{env.BUILD_TYPE}} + run: | + cmake --build "build/shared" --config ${{env.BUILD_TYPE}} + cmake --build "build/static" --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/" + run: | + cmake --install "build/shared" --config ${{env.BUILD_TYPE}} --prefix "install/shared/" + cmake --install "build/static" --config ${{env.BUILD_TYPE}} --prefix "install/static/" + - name: Preparing for Upload + run: | + mkdir "artifacts" + cp "install/shared/lib64/libragephoto.so" \ + "install/static/lib64/libragephoto.a" \ + "artifacts/" - name: Upload uses: actions/upload-artifact@v5 with: name: Linux ${{matrix.arch}} - path: ${{github.workspace}}/install/lib64/libragephoto.so + path: ${{github.workspace}}/artifacts/ macOS: runs-on: ${{matrix.runner}} env: @@ -49,16 +61,28 @@ jobs: - 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 + run: | + cmake -B "${{github.workspace}}/build/shared" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_DEPLOYMENT_TARGET}} + cmake -B "${{github.workspace}}/build/static" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DRAGEPHOTO_STATIC=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_DEPLOYMENT_TARGET}} - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: | + cmake --build "${{github.workspace}}/build/shared" --config ${{env.BUILD_TYPE}} + cmake --build "${{github.workspace}}/build/static" --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/" + run: | + cmake --install "${{github.workspace}}/build/shared" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/shared/" + cmake --install "${{github.workspace}}/build/static" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/static/" + - name: Preparing for Upload + run: | + mkdir "artifacts" + cp "install/shared/lib/libragephoto.dylib" \ + "install/static/lib/libragephoto.a" \ + "artifacts/" - name: Upload uses: actions/upload-artifact@v5 with: name: macOS ${{matrix.arch}} - path: ${{github.workspace}}/install/lib/libragephoto.dylib + path: ${{github.workspace}}/artifacts/ Windows: runs-on: windows-latest strategy: @@ -79,16 +103,27 @@ jobs: 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 + run: | + cmake -B "${{github.workspace}}/build/shared" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cmake -B "${{github.workspace}}/build/static" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_EXTRACT=OFF -DRAGEPHOTO_STATIC=ON -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: | + cmake --build "${{github.workspace}}/build/shared" --config ${{env.BUILD_TYPE}} + cmake --build "${{github.workspace}}/build/static" --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" + run: | + cmake --install "${{github.workspace}}/build/shared" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/shared/" + cmake --install "${{github.workspace}}/build/static" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/static/" + - name: Preparing for Upload + run: | + mkdir "artifacts" + Copy-Item "install\shared\bin\libragephoto.dll" "artifacts\" + Copy-Item "install\static\lib\ragephoto.lib" "artifacts\" - name: Upload uses: actions/upload-artifact@v5 with: name: Windows MSVC ${{matrix.arch}} - path: ${{github.workspace}}/install/bin/libragephoto.dll + path: ${{github.workspace}}/artifacts/ Release: needs: [Linux, macOS, Windows] runs-on: windows-latest From 33dbe75e24679792d9bcf00f97d66ada5e9dde33 Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 9 Nov 2025 13:40:50 +0100 Subject: [PATCH 3/4] RagePhoto.Core.csproj: catch ragephoto.lib in wildcard pattern --- src/dotnet/RagePhoto.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet/RagePhoto.Core.csproj b/src/dotnet/RagePhoto.Core.csproj index 0cb99f7..7b92550 100644 --- a/src/dotnet/RagePhoto.Core.csproj +++ b/src/dotnet/RagePhoto.Core.csproj @@ -20,7 +20,7 @@ - + PreserveNewest From f747a19f3c6ff7ad6e83aa3a7f890a47d2002208 Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 9 Nov 2025 13:45:26 +0100 Subject: [PATCH 4/4] GitHub Actions: add missing native folder in .NET workflow --- .github/workflows/dotnet.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ea30f3c..8e13024 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -134,37 +134,37 @@ jobs: uses: actions/download-artifact@v6 with: name: Linux arm64 - path: ${{github.workspace}}/src/dotnet/runtimes/linux-arm64 + path: ${{github.workspace}}/src/dotnet/runtimes/linux-arm64/native - name: Download Linux x64 Artifacts uses: actions/download-artifact@v6 with: name: Linux x64 - path: ${{github.workspace}}/src/dotnet/runtimes/linux-x64 + path: ${{github.workspace}}/src/dotnet/runtimes/linux-x64/native - name: Download macOS arm64 Artifacts uses: actions/download-artifact@v6 with: name: macOS arm64 - path: ${{github.workspace}}/src/dotnet/runtimes/osx-arm64 + path: ${{github.workspace}}/src/dotnet/runtimes/osx-arm64/native - name: Download macOS x64 Artifacts uses: actions/download-artifact@v6 with: name: macOS x64 - path: ${{github.workspace}}/src/dotnet/runtimes/osx-x64 + path: ${{github.workspace}}/src/dotnet/runtimes/osx-x64/native - name: Download Windows arm64 Artifacts uses: actions/download-artifact@v6 with: name: Windows MSVC arm64 - path: ${{github.workspace}}/src/dotnet/runtimes/win-arm64 + path: ${{github.workspace}}/src/dotnet/runtimes/win-arm64/native - name: Download Windows x64 Artifacts uses: actions/download-artifact@v6 with: name: Windows MSVC x64 - path: ${{github.workspace}}/src/dotnet/runtimes/win-x64 + path: ${{github.workspace}}/src/dotnet/runtimes/win-x64/native - name: Download Windows x86 Artifacts uses: actions/download-artifact@v6 with: name: Windows MSVC x86 - path: ${{github.workspace}}/src/dotnet/runtimes/win-x86 + path: ${{github.workspace}}/src/dotnet/runtimes/win-x86/native - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Setup .NET