This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (141 loc) · 4.96 KB
/
build-windows.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Build gRPC for Windows
on:
push:
branches: ['release_v1.51.1']
# Inputs for reusable workflow
workflow_call:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: string
# Inputs for manually triggered workflow
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
env:
VS_CMAKE_VERSION: '3.26'
jobs:
build:
strategy:
matrix:
arch: ['32','64']
configuration: ['Release', 'Debug']
fail-fast: false
runs-on: windows-latest
steps:
- name: Install NASM
run: |
choco install -y nasm
- name: Add NASM to PATH
shell: pwsh
run: |
echo "C:/Program Files/NASM/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: NASM version
run: |
nasm.exe --version
- name: CMake version installed with Visual Studio
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
ls "c:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/"
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: 32 bit - set environment variables
if: ${{ matrix.arch == '32' }}
shell: powershell
run: |
echo "PLATFORM=win32" >> $env:GITHUB_ENV
- name: 64 bit - set environment variables
if: ${{ matrix.arch == '64' }}
shell: powershell
run: |
echo "PLATFORM=x64" >> $env:GITHUB_ENV
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
submodules: recursive
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Build gRPC ${{ matrix.arch }} bit ( ${{ matrix.configuration }} )
working-directory: ${{ github.workspace }}/build_windows_${{ matrix.arch }}
shell: cmd
run: |
msbuild.exe -maxcpucount /t:Build /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ env.PLATFORM }} /fl /flp:logfile=build-${{ matrix.arch }}.${{ matrix.configuration }}.log;verbosity=diagnostic grpc.sln
- name: Upload artifacts for gRPC ${{ matrix.arch }} bit ( ${{ matrix.configuration }} )
uses: actions/upload-artifact@v3
with:
name: build_${{ matrix.arch }}_${{ matrix.configuration }}
retention-days: 1
path: |
${{ github.workspace }}\build_windows_${{ matrix.arch }}\**\*.lib
archive:
needs: build
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
submodules: recursive
- name: Create directories
shell: pwsh
run: |
mkdir -p ${{ github.workspace }}/temp/
mkdir -p ${{ github.workspace }}/temp/build_windows_32
mkdir -p ${{ github.workspace }}/temp/build_windows_64
- name: Download artifacts for gRPC 32 (Release)
uses: actions/download-artifact@v3
with:
name: build_32_Release
path: ${{ github.workspace }}/temp/build_windows_32
if-no-files-found: error
- name: Download artifacts for gRPC 32 (Debug)
uses: actions/download-artifact@v3
with:
name: build_32_Debug
path: ${{ github.workspace }}/temp/build_windows_32
if-no-files-found: error
- name: Download artifacts for gRPC 64 (Release)
uses: actions/download-artifact@v3
with:
name: build_64_Release
path: ${{ github.workspace }}/temp/build_windows_64
if-no-files-found: error
- name: Download artifacts for gRPC 64 (Debug)
uses: actions/download-artifact@v3
with:
name: build_64_Debug
path: ${{ github.workspace }}/temp/build_windows_64
if-no-files-found: error
- name: List artifacts
shell: pwsh
run: |
ls -R ${{ github.workspace }}/temp
- name: Determine version
shell: powershell
run: |
$version = "${{ github.sha }}".Substring(0,7)
echo "VERSION=$version" >> $env:GITHUB_ENV
- name: Create archive
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
$source = "${{ github.workspace }}\temp"
$destination = "${{ github.workspace }}"
.\create-grpc-archive.ps1 -Source $source -Destination $destination -Version ${{ env.VERSION }}
- name: Upload archive for gRPC
uses: actions/upload-artifact@v3
with:
name: grpc
path: |
${{ github.workspace }}\*.zip.${{ env.VERSION }}