@@ -80,120 +80,3 @@ jobs:
8080 with :
8181 name : ${{matrix.pkg.type}}-${{matrix.cpu.platform}}
8282 path : ${{matrix.pkg.path}}
83-
84- package-windows :
85- timeout-minutes : 120
86- name : Build CPP Client on ${{ matrix.name }}
87- runs-on : ${{ matrix.os }}
88- env :
89- VCPKG_ROOT : ' ${{ github.workspace }}/vcpkg'
90- INSTALL_DIR : ' C:\\pulsar-cpp'
91- strategy :
92- fail-fast : false
93- matrix :
94- include :
95- - name : ' Windows x64'
96- os : windows-2019
97- triplet : x64-windows-static
98- suffix : ' windows-win64'
99- generator : ' Visual Studio 16 2019'
100- arch : ' -A x64'
101- - name : ' Windows x86'
102- os : windows-2019
103- triplet : x86-windows-static
104- suffix : ' windows-win32'
105- generator : ' Visual Studio 16 2019'
106- arch : ' -A Win32'
107-
108- steps :
109- - name : checkout
110- uses : actions/checkout@v3
111-
112- - name : Restore vcpkg and its artifacts.
113- uses : actions/cache@v3
114- id : vcpkg-cache
115- with :
116- path : |
117- ${{ env.VCPKG_ROOT }}
118- vcpkg_installed
119- !${{ env.VCPKG_ROOT }}/.git
120- !${{ env.VCPKG_ROOT }}/buildtrees
121- !${{ env.VCPKG_ROOT }}/packages
122- !${{ env.VCPKG_ROOT }}/downloads
123- key : |
124- ${{ runner.os }}-${{ matrix.triplet }}-${{ hashFiles( 'vcpkg.json' ) }}
125-
126- - name : Get vcpkg(windows)
127- if : ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
128- run : |
129- cd ${{ github.workspace }}
130- mkdir build -force
131- git clone https://github.com/Microsoft/vcpkg.git
132- cd vcpkg
133- .\bootstrap-vcpkg.bat
134-
135- - name : remove system vcpkg(windows)
136- if : runner.os == 'Windows'
137- run : rm -rf "$VCPKG_INSTALLATION_ROOT"
138- shell : bash
139-
140- - name : Install vcpkg packages
141- run : |
142- # See https://github.com/microsoft/vcpkg/issues/32600#issuecomment-1638907069
143- mkdir -p ${{ env.VCPKG_ROOT }}/downloads
144- cd ${{ env.VCPKG_ROOT }}/downloads
145- curl -O -L https://github.com/microsoft/vcpkg/files/12073957/nasm-2.16.01-win64.zip
146- cd -
147- ${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }} > dependencies.txt
148-
149- - name : Build and package
150- shell : bash
151- run : |
152- BUILD_DIR=./build
153- mkdir -p $BUILD_DIR
154- cmake -B $BUILD_DIR \
155- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
156- -DBUILD_TESTS=OFF \
157- -DVCPKG_TRIPLET=${{ matrix.triplet }} \
158- -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
159- -S .
160- cmake --build $BUILD_DIR --parallel --config Release
161- cmake --install $BUILD_DIR
162- cp dependencies.txt ${{ env.INSTALL_DIR }}
163-
164- - name : Zip artifact
165- shell : bash
166- run : 7z a -tzip pulsar-client-cpp-${{ matrix.triplet }}.zip ${{ env.INSTALL_DIR }}/*
167-
168- - name : Upload artifacts
169- uses : actions/upload-artifact@v3
170- with :
171- name : ${{ matrix.triplet }}
172- path : ${{ env.INSTALL_DIR }}
173-
174- - name : Build and package (Debug)
175- shell : bash
176- run : |
177- BUILD_DIR=./build-debug
178- INSTALL_DIR_DEBUG=${{ env.INSTALL_DIR }}-Debug
179- mkdir -p $BUILD_DIR
180- cmake -B $BUILD_DIR \
181- -G "${{ matrix.generator }}" ${{ matrix.arch }} \
182- -DBUILD_TESTS=OFF \
183- -DVCPKG_TRIPLET=${{ matrix.triplet }} \
184- -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR_DEBUG \
185- -DCMAKE_BUILD_TYPE=Debug \
186- -S .
187- cmake --build $BUILD_DIR --parallel --config Debug
188- cmake --install $BUILD_DIR --config Debug
189- cp dependencies.txt $INSTALL_DIR_DEBUG
190-
191- - name : Zip artifact (Debug)
192- shell : bash
193- run : 7z a -tzip pulsar-client-cpp-${{ matrix.triplet }}-Debug.zip ${{ env.INSTALL_DIR }}-Debug/*
194-
195- - name : Upload artifacts (Debug)
196- uses : actions/upload-artifact@v3
197- with :
198- name : ${{ matrix.triplet }}-Debug
199- path : ${{ env.INSTALL_DIR }}-Debug
0 commit comments