[CI] switch windows to using vcpkg #64
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
# 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: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 \ | |
-DVCPKG_LIBRARY_LINKAGE=static \ | |
-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 }} |