-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (71 loc) · 3.57 KB
/
cpp-client.yml
File metadata and controls
85 lines (71 loc) · 3.57 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Test building protobuf in Windows
name: cpp-client
# 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-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get compiled protobuf lib
uses: dawidd6/action-download-artifact@v2
with:
workflow: protobuf.yml
workflow_conclusion: success
# Optional, uploaded artifact name,
# will download all artifacts if not specified
# and extract them in respective subdirectories
# https://github.com/actions/download-artifact#download-all-artifacts
name: protobuf-artifact
path: protobuf
- name: Get asio
run: |
Invoke-WebRequest "https://telkomuniversity.dl.sourceforge.net/project/asio/asio/1.22.1%20%28Stable%29/asio-1.22.1.zip" -OutFile "asio-1.22.1.zip"
7z x asio-1.22.1.zip
- name: Get the krpc lib
uses: dawidd6/action-download-artifact@v2
with:
workflow: main.yml
workflow_conclusion: success
# Optional, uploaded artifact name,
# will download all artifacts if not specified
# and extract them in respective subdirectories
# https://github.com/actions/download-artifact#download-all-artifacts
name: krpc
repo: nullprofile/krpc
- name: Unpack krpc lib
run: |
7z x krpc-0.4.9.zip client/krpc-cpp-0.4.9.zip
7z x client\krpc-cpp-0.4.9.zip
- name: Set environment variables
run: |
echo ("CMAKE_ARG1=-DCMAKE_BUILD_TYPE=Release") >> $env:GITHUB_ENV
echo ("CMAKE_ARG2=-DCMAKE_INSTALL_PREFIX=krpc-install") >> $env:GITHUB_ENV
echo ("CMAKE_ARG3=-DASIO_INCLUDE_DIR=" + $((Get-Item .).FullName) + "/asio-1.22.1/include") >> $env:GITHUB_ENV
echo ("CMAKE_ARG4=-DProtobuf_INCLUDE_DIR=" + $((Get-Item .).FullName) + "/protobuf/include") >> $env:GITHUB_ENV
echo ("CMAKE_ARG5=-DProtobuf_LIBRARY_RELEASE=" + $((Get-Item .).FullName) + "/protobuf/lib/libprotobuf.lib") >> $env:GITHUB_ENV
echo ("CMAKE_ARG6=-DProtobuf_LITE_LIBRARY_RELEASE=" + $((Get-Item .).FullName) + "/protobuf/lib/libprotobuf-lite.lib") >> $env:GITHUB_ENV
echo ("CMAKE_ARG7=-DProtobuf_PROTOC_EXECUTABLE=" + $((Get-Item .).FullName) + "/protobuf/bin/protoc.exe") >> $env:GITHUB_ENV
echo ("CMAKE_ARG8=-DProtobuf_PROTOC_LIBRARY_RELEASE=" + $((Get-Item .).FullName) + "/protobuf/lib/libprotoc.lib") >> $env:GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1
- name: Compile
run: |
echo ("WORKING_DIR=" + $((Get-Item .).FullName)) >> $env:GITHUB_ENV
echo "DIR: ${env:WORKING_DIR}"
cd krpc-cpp-0.4.9
mkdir build
cd build
cmake -G "NMake Makefiles" ${env:CMAKE_ARG1} ${env:CMAKE_ARG2} ${env:CMAKE_ARG3} ${env:CMAKE_ARG4} ${env:CMAKE_ARG5} ${env:CMAKE_ARG6} ${env:CMAKE_ARG7} ${env:CMAKE_ARG8} ..
nmake
nmake install
- name: Copy files
run: xcopy /E '.\krpc-cpp-0.4.9\build\krpc-install' '.\krpc-cpp-client\'
- uses: actions/upload-artifact@v3
with:
name: krpc-cpp-client
path: krpc-cpp-client/