Skip to content

add github actions build workflow for main and manual dispatch #1

add github actions build workflow for main and manual dispatch

add github actions build workflow for main and manual dispatch #1

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build (vs2022, Release, x86)
runs-on: windows-2022
env:
# vcpkg binary cache so dependencies are not recompiled on every run
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_bincache
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Resolve vcpkg submodule commit
id: vcpkg
shell: pwsh
run: "\"sha=$(git -C vcpkg rev-parse HEAD)\" >> $env:GITHUB_OUTPUT"
- name: Prepare vcpkg binary cache directory
shell: pwsh
run: New-Item -ItemType Directory -Force -Path "$env:VCPKG_DEFAULT_BINARY_CACHE" | Out-Null
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg_bincache
key: vcpkg-x86-static-${{ runner.os }}-${{ steps.vcpkg.outputs.sha }}-${{ hashFiles('vcpkg.json', 'custom-vcpkg-ports/**') }}
restore-keys: |
vcpkg-x86-static-${{ runner.os }}-${{ steps.vcpkg.outputs.sha }}-
vcpkg-x86-static-${{ runner.os }}-
- name: Bootstrap vcpkg
shell: pwsh
run: .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Configure
shell: pwsh
run: |
$installDir = "$env:GITHUB_WORKSPACE/install".Replace('\', '/')
cmake --preset vs2022 -DNEXTCLIENT_INSTALL_DIR="$installDir"
- name: Build
shell: pwsh
run: cmake --build --preset vs2022-release --target BUILD_ALL
- name: Collect PDBs
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path install/pdb | Out-Null
Copy-Item -Path out/pdb/Release/*.pdb -Destination install/pdb -Force
- name: Resolve short commit
id: meta
shell: pwsh
run: "\"short=$($env:GITHUB_SHA.Substring(0, 7))\" >> $env:GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: NextClient-${{ steps.meta.outputs.short }}
path: install/
if-no-files-found: error