[windows CI] get protobuf binaries from external source #18
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: Download protobuf | |
run: | | |
Invoke-WebRequest "https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win64.zip" -OutFile protoc_x64-windows.zip | |
dir | |
mkdir protoc_x64-windows | |
7z x protobuf_x64-windows.zip -oprotoc_x64-windows | |
dir | |
Invoke-WebRequest "https://www.dropbox.com/scl/fi/te9p80zrzcwgswrkw21en/protobuf_x64-windows.zip?rlkey=btmzjokhh256xxns348o3re7m&dl=1" -OutFile protobuf_x64-windows.zip | |
dir | |
7z x protobuf_x64-windows.zip | |
dir | |
- name: CMake generate | |
shell: bash | |
env: | |
ARTIFACT_NAME: ppc2cpp-${{ runner.os }} | |
run: | | |
cmake --version | |
cmake -B build -GNinja \ | |
-DCMAKE_INSTALL_PREFIX=$ARTIFACT_NAME \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DBUILD_TESTING=OFF \ | |
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ | |
-DEXTERNAL_LIBPROTOBUF_PATH=protobuf_x64-windows \ | |
-DEXTERNAL_PROTOC_PATH=protoc_x64-windows | |
cat build.ninja | |
- name: Build | |
shell: bash | |
run: cmake --build build --target install --parallel | |
- 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 }} |