Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 115 additions & 5 deletions .github/workflows/ci-build-binary-artifacts.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ concurrency:

jobs:

package:
package-linux:
name: Build ${{matrix.pkg.name}} ${{matrix.cpu.platform}}
runs-on: ubuntu-22.04
timeout-minutes: 500
Expand DownExpand Up@@ -72,8 +72,118 @@ jobs:
- name: Build packages
run: pkg/${{matrix.pkg.type}}/docker-build-${{matrix.pkg.type}}-${{matrix.cpu.platform}}.sh build:latest

- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Zip artifact
run: zip -r ${{matrix.pkg.type}}-${{matrix.cpu.platform}}.zip ${{matrix.pkg.path}}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{matrix.pkg.type}}-${{matrix.cpu.platform}}.zip
asset_name: ${{matrix.pkg.type}}-${{matrix.cpu.platform}}.zip
tag: ${{ github.ref }}
overwrite: true

package-windows:
timeout-minutes: 120
name: Build CPP Client on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'
strategy:
fail-fast: false
matrix:
include:
- name: 'Windows x64'
os: windows-2022
triplet: x64-windows
vcpkg_dir: 'C:\vcpkg'
suffix: 'windows-win64'
generator: 'Visual Studio 17 2022'
arch: '-A x64'
- name: 'Windows x86'
os: windows-2022
triplet: x86-windows
vcpkg_dir: 'C:\vcpkg'
suffix: 'windows-win32'
generator: 'Visual Studio 17 2022'
arch: '-A Win32'

steps:
- name: checkout
uses: actions/checkout@v3

- name: Restore vcpkg and its artifacts.
uses: actions/cache@v3
id: vcpkg-cache
with:
path: |
${{ env.VCPKG_ROOT }}
vcpkg_installed
!${{ env.VCPKG_ROOT }}/.git
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
key: |
${{ runner.os }}-${{ matrix.triplet }}-${{ hashFiles( 'vcpkg.json' ) }}

- name: Get vcpkg(windows)
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
run: |
cd ${{ github.workspace }}
mkdir build -force
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat

- name: remove system vcpkg(windows)
if: runner.os == 'Windows'
run: rm -rf "$VCPKG_INSTALLATION_ROOT"
shell: bash

- name: Install vcpkg packages
run: |
${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }} > dependencies.txt

- name: Configure and build
shell: bash
run: |
BUILD_DIR=./build
mkdir -p $BUILD_DIR
cmake -B $BUILD_DIR \
-G "${{ matrix.generator }}" ${{ matrix.arch }} \
-DBUILD_TESTS=OFF \
-DVCPKG_TRIPLET=${{ matrix.triplet }} \
-S .
cmake --build $BUILD_DIR --parallel --config Release

- name: Package
shell: bash
run: |
BUILD_DIR=./build
PACKAGE_DIR=./package
LIB_DIR=$PACKAGE_DIR/lib/Release
VCPKG_INSTALLED_DIR=$PACKAGE_DIR/vcpkg_installed
mkdir -p $PACKAGE_DIR
mkdir -p $LIB_DIR
mkdir -p $VCPKG_INSTALLED_DIR/${{ matrix.triplet }}

cp dependencies.txt $PACKAGE_DIR
cp -r ./include $PACKAGE_DIR
cp -r $BUILD_DIR/include/ $PACKAGE_DIR
cp -r $BUILD_DIR/lib/Release/*.lib $LIB_DIR
cp -r $BUILD_DIR/lib/Release/*.dll $LIB_DIR
cp -r ./vcpkg_installed/${{ matrix.triplet }}/* $VCPKG_INSTALLED_DIR/${{ matrix.triplet }}

- name: Zip artifact
shell: bash
run: 7z a -tzip Windows-${{ matrix.triplet }}.zip ./package

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
name: ${{matrix.pkg.type}}-${{matrix.cpu.platform}}
path: ${{matrix.pkg.path}}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Windows-${{ matrix.triplet }}.zip
asset_name: Windows-${{ matrix.triplet }}.zip
tag: ${{ github.ref }}
overwrite: true
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr-validation.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@ jobs:
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
key: |
${{ runner.os }}-${{ matrix.triplet}}-${{ hashFiles( 'pulsar-client-cpp/vcpkg.json' ) }}
${{ runner.os }}-${{ matrix.triplet}}-${{ hashFiles( 'vcpkg.json' ) }}

- name: Get vcpkg(windows)
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
Expand Down