GitHub Actions: build more variants

This commit is contained in:
Syping 2025-10-22 02:44:47 +02:00
parent 24a64d8740
commit cd5a160d70
7 changed files with 57 additions and 50 deletions

View file

@ -7,19 +7,18 @@ jobs:
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cloning
uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt-get update -qq
sudo apt-get install cmake gcc g++ ninja-build -qq
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -GNinja
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
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/usr/local
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local"
- name: Upload
uses: actions/upload-artifact@v4
with:

View file

@ -6,23 +6,27 @@ jobs:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Release
strategy:
matrix:
cxxstd:
- 11
- 17
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cloning
uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt-get update -qq
sudo apt-get install cmake gcc g++ ninja-build -qq
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DRAGEPHOTO_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=${{matrix.cxxstd}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
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/usr/local
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Ubuntu
name: Ubuntu C++${{matrix.cxxstd}}
path: |
${{github.workspace}}/install/

View file

@ -7,9 +7,8 @@ jobs:
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cloning
uses: actions/checkout@v4
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
@ -19,9 +18,9 @@ jobs:
sudo apt-get update -qq
sudo apt-get install cmake ninja-build -qq
- name: Configure CMake
run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -GNinja
run: emcmake cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- name: Upload
uses: actions/upload-artifact@v4
with:

View file

@ -7,9 +7,8 @@ jobs:
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cloning
uses: actions/checkout@v4
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
@ -19,9 +18,9 @@ jobs:
sudo apt-get update -qq
sudo apt-get install cmake ninja-build -qq
- name: Configure CMake
run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_CXX_STANDARD=11 -GNinja
run: emcmake cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- name: Upload
uses: actions/upload-artifact@v4
with:

View file

@ -13,18 +13,18 @@ jobs:
- amd64_x86
- amd64_arm64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: Cloning
uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -GNinja
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
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
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload
uses: actions/upload-artifact@v4
with:

View file

@ -12,22 +12,25 @@ jobs:
- amd64
- amd64_x86
- amd64_arm64
cxxstd:
- 11
- 17
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: Cloning
uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DRAGEPHOTO_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_UNICODE=wincvt -GNinja
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=${{matrix.cxxstd}} -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
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
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Windows MSVC ${{matrix.arch}}
name: Windows MSVC C++${{matrix.cxxstd}} ${{matrix.arch}}
path: |
${{github.workspace}}/install/

View file

@ -15,15 +15,16 @@ jobs:
steps:
- name: Cloning
uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -GNinja
run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
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
run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install"
- name: Upload
uses: actions/upload-artifact@v4
with:
@ -33,6 +34,9 @@ jobs:
Release:
needs: Native
runs-on: windows-latest
defaults:
run:
shell: pwsh
env:
BUILD_TYPE: Release
steps:
@ -54,14 +58,13 @@ jobs:
name: Windows MSVC amd64_arm64
path: assets/amd64_arm64
- name: Copy Assets
shell: pwsh
run: |
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\amd64_arm64\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll
cp ${{github.workspace}}\assets\amd64\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll
cp ${{github.workspace}}\assets\amd64_x86\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-x86\native\libragephoto.dll
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\amd64_arm64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll"
cp "${{github.workspace}}\assets\amd64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll"
cp "${{github.workspace}}\assets\amd64_x86\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x86\native\libragephoto.dll"
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup .NET
@ -69,7 +72,7 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Build Syping.RagePhoto.Core
run: msbuild ${{github.workspace}}\src\dotnet\Syping.RagePhoto.Core.csproj /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}}
run: msbuild "${{github.workspace}}\src\dotnet\Syping.RagePhoto.Core.csproj" /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}}
- name: Upload
uses: actions/upload-artifact@v4
with: