This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
checkout before creating archive #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build gRPC for Windows | |
on: | |
push: | |
branches: ['nh-57056-cpp17-github-actions-temp'] | |
# 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: | | |
echo 'ALEX' > ${{ github.workspace }}\build_windows_${{ matrix.arch }}\test_${{ matrix.arch }}_${{ matrix.configuration }}.lib | |
rem 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 }} | |
path: | | |
${{ github.workspace }}\build_windows_${{ matrix.arch }}\**\*.lib | |
archive: | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- name: Download artifacts for gRPC 32 (Release) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_32_Release | |
path: ${{ github.workspace }}\artifacts | |
- name: Download artifacts for gRPC 64 (Release) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_64_Release | |
path: ${{ github.workspace }}\artifacts | |
- name: Download artifacts for gRPC 32 (Debug) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_32_Debug | |
path: ${{ github.workspace }}\artifacts | |
- name: Download artifacts for gRPC 64 (Debug) | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_64_Debug | |
path: ${{ github.workspace }}\artifacts | |
- name: List artifacts | |
shell: pwsh | |
run: | | |
ls -R ${{ github.workspace }}/artifacts | |
- 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 archive | |
shell: pwsh | |
working-directory: ${{ github.workspace }} | |
run: | | |
.\create-grpc-archive.ps1 -Source ${{ github.workspace }}/artifacts -Destination ${{ github.workspace }} -Version '12345' | |
- name: Upload artifacts for gRPC | |
uses: actions/upload-artifact@v3 | |
with: | |
name: grpc | |
path: | | |
${{ github.workspace }}\*.zip.12345 | |