Skip to content

[CI] switch windows to using vcpkg #62

[CI] switch windows to using vcpkg

[CI] switch windows to using vcpkg #62

Workflow file for this run

# Build and push artifacts
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-push:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install LLVM
run: choco install -y llvm
- name: Install Ninja
run: choco install -y ninja
- name: Setup vcpkg
shell: bash
run: |
where vcpkg
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
where vcpkg
./vcpkg/vcpkg install protobuf protobuf:x64-windows-static
- name: CMake generate
shell: bash
env:
ARTIFACT_NAME: ppc2cpp-${{ runner.os }}
run: |
cmake -S . -B build -GNinja \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_PREFIX_PATH=protobuf_x64-windows
- name: Build
shell: bash
env:
ARTIFACT_NAME: ppc2cpp-${{ runner.os }}
run: |
cmake --build build --target install --parallel --verbose
ls -lh $ARTIFACT_NAME
ls -lh $ARTIFACT_NAME/bin
ls -lh $ARTIFACT_NAME/lib
- uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main' && github.repository == 'em-eight/ppc2cpp'
with:
name: ppc2cpp-${{ runner.os }}
path: ppc2cpp-${{ runner.os }}