-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (40 loc) · 1.73 KB
/
protobuf.yml
File metadata and controls
50 lines (40 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Test building protobuf in Windows
name: Protobuf
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-2019
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get the protobuf source
run: Invoke-WebRequest "https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protobuf-cpp-3.19.4.zip" -OutFile "protobuf.zip"
- name: Unpack protobuf library
run: 7z x protobuf.zip
- name: Set environment variables
run: |
echo ("SRC_INSTALL=" + $((Get-Item .).FullName) + "\protobuf-3.19.4\cmake\build\release\protobuf-install\") >> $env:GITHUB_ENV
echo ("DEST_INSTALL=" + $((Get-Item .).FullName) + "\protobuf-install\") >> $env:GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1
- name: Compile
run: |
cd protobuf-3.19.4
cd cmake
mkdir build
cd build
mkdir release
cd release
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=protobuf-install ../..
cmake --build . --config Release
cmake --build . --target INSTALL --config Release
- name: Copy files
run: xcopy /E ${env:SRC_INSTALL} ${env:DEST_INSTALL}
- uses: actions/upload-artifact@v3
with:
name: protobuf-artifact
path: protobuf-install/