Actions pipeline - windows
This commit is contained in:
@@ -4,8 +4,17 @@ name: Build
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build (${{ matrix.target }})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: linux
|
||||||
|
pack_ext: tar.gz
|
||||||
|
- target: windows
|
||||||
|
pack_ext: zip
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -23,59 +32,96 @@ jobs:
|
|||||||
- name: Apt update
|
- name: Apt update
|
||||||
run: sudo apt update
|
run: sudo apt update
|
||||||
|
|
||||||
- name: Installing build chain
|
- name: Installing build chain (Linux)
|
||||||
|
if: matrix.target == 'linux'
|
||||||
run: sudo apt-get install pigz ninja-build g++ clang pkg-config cmake libtbb-dev
|
run: sudo apt-get install pigz ninja-build g++ clang pkg-config cmake libtbb-dev
|
||||||
g++-mingw-w64-x86-64 -y;
|
-y
|
||||||
|
|
||||||
|
- name: Installing build chain (Windows Cross-Compile)
|
||||||
|
if: matrix.target == 'windows'
|
||||||
|
run: sudo apt-get install pigz ninja-build g++-mingw-w64-x86-64 cmake -y
|
||||||
|
|
||||||
- name: Cache CPM
|
- name: Cache CPM
|
||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: "~/.cache/CPM/"
|
path: "~/.cache/CPM/"
|
||||||
key: ${{ runner.os }}-CPM
|
key: ${{ runner.os }}-${{ matrix.target }}-CPM
|
||||||
|
|
||||||
- name: Configure debug
|
- name: Configure debug
|
||||||
run: mkdir -p build; mkdir -p build/debug; cd build/debug;
|
run: |
|
||||||
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja
|
mkdir -p build/debug
|
||||||
-DCMAKE_BUILD_TYPE=Debug;
|
cd build/debug
|
||||||
|
if [ "${{ matrix.target }}" = "windows" ]; then
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
|
||||||
|
else
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Configure Release
|
- name: Configure Release
|
||||||
run: mkdir -p build; mkdir -p build/release; cd build/release;
|
run: |
|
||||||
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja
|
mkdir -p build/release
|
||||||
-DCMAKE_BUILD_TYPE=Release;
|
cd build/release
|
||||||
|
if [ "${{ matrix.target }}" = "windows" ]; then
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
|
||||||
|
fi
|
||||||
|
if [ "${{ matrix.target }}" = "linux" ]; then
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Configure MinSizeRel
|
- name: Configure MinSizeRel
|
||||||
run: mkdir -p build; mkdir -p build/minsizerel; cd build/minsizerel;
|
run: |
|
||||||
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja
|
mkdir -p build/minsizerel
|
||||||
-DCMAKE_BUILD_TYPE=MinSizeRel;
|
cd build/minsizerel
|
||||||
|
if [ "${{ matrix.target }}" = "windows" ]; then
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
|
||||||
|
else
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Configure RelWithDeb
|
- name: Configure RelWithDeb
|
||||||
run: mkdir -p build; mkdir -p build/relwithdeb; cd build/relwithdeb;
|
run: |
|
||||||
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja
|
mkdir -p build/relwithdeb
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDeb;
|
cd build/relwithdeb
|
||||||
|
if [ "${{ matrix.target }}" = "windows" ]; then
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/" cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDeb -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
|
||||||
|
else
|
||||||
|
CPM_SOURCE_CACHE="~/.cache/CPM/"cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDeb
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build debug
|
- name: Build debug
|
||||||
run: cd build/debug; ninja;
|
run: cd build/debug && ninja
|
||||||
|
|
||||||
- name: Build Release
|
- name: Build Release
|
||||||
run: cd build/release; ninja;
|
run: cd build/release && ninja
|
||||||
|
|
||||||
- name: Build RelWithDeb
|
- name: Build RelWithDeb
|
||||||
run: cd build/relwithdeb; ninja;
|
run: cd build/relwithdeb && ninja
|
||||||
|
|
||||||
- name: Build MinSizeRel
|
- name: Build MinSizeRel
|
||||||
run: cd build/minsizerel; ninja;
|
run: cd build/minsizerel && ninja
|
||||||
|
|
||||||
- name: Packaging
|
- name: Packaging Linux
|
||||||
run: |-
|
if: matrix.target == 'linux'
|
||||||
tar -I 'pigz -9' -cf buildscript-debug-amd64.tar.gz --transform 's,^,build-script/,' build/debug LICENSE;
|
run: |
|
||||||
tar -I 'pigz -9' -cf buildscript-release-amd64.tar.gz --transform 's,^,build-script/,' build/release LICENSE;
|
tar -I 'pigz -9' -cf buildscript-debug-amd64.tar.gz --transform 's,^,build-script/,' build/debug LICENSE
|
||||||
tar -I 'pigz -9' -cf buildscript-relwithdeb-amd64.tar.gz --transform 's,^,build-script/,' build/relwithdeb LICENSE;
|
tar -I 'pigz -9' -cf buildscript-release-amd64.tar.gz --transform 's,^,build-script/,' build/release LICENSE
|
||||||
tar -I 'pigz -9' -cf buildscript-minsizerel-amd64.tar.gz --transform 's,^,build-script/,' build/minsizerel LICENSE;
|
tar -I 'pigz -9' -cf buildscript-relwithdeb-amd64.tar.gz --transform 's,^,build-script/,' build/relwithdeb LICENSE
|
||||||
|
tar -I 'pigz -9' -cf buildscript-minsizerel-amd64.tar.gz --transform 's,^,build-script/,' build/minsizerel LICENSE
|
||||||
|
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- name: Packaging Windows
|
||||||
|
if: matrix.target == 'windows'
|
||||||
|
run: |
|
||||||
|
sudo apt-get install zip -y
|
||||||
|
zip -r9 buildscript-debug-x64.zip build/debug LICENSE
|
||||||
|
zip -r9 buildscript-release-x64.zip build/release LICENSE
|
||||||
|
zip -r9 buildscript-relwithdeb-x64.zip build/relwithdeb LICENSE
|
||||||
|
zip -r9 buildscript-minsizerel-x64.zip build/minsizerel LICENSE
|
||||||
|
|
||||||
|
- name: Upload Release Assets
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
files: |-
|
files: |-
|
||||||
buildscript-debug-amd64.tar.gz
|
buildscript-debug-*.${{ matrix.pack_ext }}
|
||||||
buildscript-release-amd64.tar.gz
|
buildscript-release-*.${{ matrix.pack_ext }}
|
||||||
buildscript-relwithdeb-amd64.tar.gz
|
buildscript-relwithdeb-*.${{ matrix.pack_ext }}
|
||||||
buildscript-minsizerel-amd64.tar.gz
|
buildscript-minsizerel-*.${{ matrix.pack_ext }}
|
||||||
|
|||||||
Reference in New Issue
Block a user