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: env:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v4 - name: Cloning
with: uses: actions/checkout@v4
submodules: recursive
- name: Install packages - name: Install packages
run: | run: |
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install cmake gcc g++ ninja-build -qq sudo apt-get install cmake gcc g++ ninja-build -qq
- name: Configure CMake - 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 - name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- 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@v4
with: with:

View file

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

View file

@ -7,9 +7,8 @@ jobs:
env: env:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v4 - name: Cloning
with: uses: actions/checkout@v4
submodules: recursive
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14 uses: mymindstorm/setup-emsdk@v14
with: with:
@ -19,9 +18,9 @@ jobs:
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install cmake ninja-build -qq sudo apt-get install cmake ninja-build -qq
- name: Configure CMake - 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 - 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@v4
with: with:

View file

@ -7,9 +7,8 @@ jobs:
env: env:
BUILD_TYPE: Release BUILD_TYPE: Release
steps: steps:
- uses: actions/checkout@v4 - name: Cloning
with: uses: actions/checkout@v4
submodules: recursive
- name: Setup emsdk - name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14 uses: mymindstorm/setup-emsdk@v14
with: with:
@ -19,9 +18,9 @@ jobs:
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install cmake ninja-build -qq sudo apt-get install cmake ninja-build -qq
- name: Configure CMake - 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 - 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@v4
with: with:

View file

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

View file

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

View file

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