GitHub Actions: add static build to .NET workflow
This commit is contained in:
parent
02ad50b373
commit
926a49033c
1 changed files with 47 additions and 12 deletions
59
.github/workflows/dotnet.yml
vendored
59
.github/workflows/dotnet.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue