ci: clean workflow #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '.github/workflows/clean_workflow.yml' | |
- '.github/workflows/prebuild.yml' | |
- '.github/workflows/farcolorer-release.yml' | |
- 'ci/**' | |
- 'docs/**' | |
- 'scripts/**' | |
- '.clang-format' | |
- '.gitignore' | |
- 'CMakePresets.json' | |
- 'LICENSE' | |
- 'README.md' | |
- 'version4far.txt' | |
pull_request: | |
branches: | |
- master | |
env: | |
BUILD_TYPE: Release | |
X_VCPKG_NUGET_ID_PREFIX: 'farcolorer' | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [ x64, x86 , ARM64 ] | |
include: | |
- { build: x64, arch: amd64, triplet: x64-windows-static-rel, } | |
- { build: x86, arch: amd64_x86, triplet: x86-windows-static-rel, } | |
- { build: ARM64, arch: amd64_arm64, triplet: arm64-windows-static-rel, } | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Install vcpkg | |
run: | | |
cd external\colorer\external\vcpkg | |
.\bootstrap-vcpkg.bat | |
- name: Add C++ build tools to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Setup NuGet Credentials for cache | |
shell: bash | |
run: > | |
`$VCPKG_INSTALLATION_ROOT/vcpkg fetch nuget | tail -n 1` | |
sources add | |
-source "https://nuget.pkg.github.com/colorer/index.json" | |
-storepasswordincleartext | |
-name "GitHub" | |
-username "${{ secrets.PACKAGES_GITHUB_USER }}" | |
-password "${{ secrets.PACKAGES_GITHUB_TOKEN }}" | |
- name: Create Build folder | |
run: mkdir -p _build | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores | |
- name: Configure CMake | |
shell: bash | |
run: > | |
cmake -S . -B _build -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_ARCH=${{ matrix.build }} | |
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/colorer/external/vcpkg/scripts/buildsystems/vcpkg.cmake | |
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | |
-DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/colorer/external/vcpkg-ports | |
-DVCPKG_OVERLAY_TRIPLETS=$GITHUB_WORKSPACE/external/colorer/external/vcpkg-triplets | |
-DVCPKG_FEATURE_FLAGS=manifests,versions | |
- name: Build | |
shell: bash | |
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }} | |