update protobuf to v3.33.2 #394
This file contains hidden or 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: OVFToolsBuildTestDeploy | |
| on: [push, pull_request] | |
| jobs: | |
| check_license: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Check license headers | |
| run: python manage_license_headers.py ci | |
| build_and_test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Setup Dotnet sdk | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Remove GUI Projects (Linux) | |
| if: contains(matrix.os, 'ubuntu') | |
| run: dotnet sln OpenVectorFormatTools.sln remove OVFFileConverterGUI/OVFFileConverterGUI.csproj | |
| - name: Build | |
| run: dotnet build --configuration Release | |
| - name: Test Linux | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| dotnet run --configuration Release --framework net8.0 --no-build --project ReaderWriter/FileReaderWriterFactoryGRPCWrapper/FileReaderWriterFactoryGRPCWrapper.csproj & | |
| grpcpid="$!" | |
| echo "started grpc server" | |
| sleep 5s | |
| dotnet test --no-build --configuration Release --framework net8.0 | |
| kill $grpcpid | |
| - name: Test Windows | |
| if: contains(matrix.os, 'windows') | |
| run: | | |
| $j = Start-Process -PassThru -Filepath 'dotnet' -WorkingDirectory $PWD -ArgumentList 'run --configuration Release --framework net8.0 --no-build --project .\ReaderWriter\FileReaderWriterFactoryGRPCWrapper\FileReaderWriterFactoryGRPCWrapper.csproj' | |
| Start-Sleep -s 5 | |
| dotnet test --no-build --configuration Release | |
| $j | Select-Object -Property Id | Stop-Process | |
| publish_nuget: | |
| needs: [check_license, build_and_test] | |
| if: startsWith(github.ref, 'refs/tags/v') # make sure deploy only runs on tags with version number | |
| runs-on: windows-latest | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Setup Dotnet sdk | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Build Windows | |
| run: | | |
| dotnet sln OpenVectorFormatTools.sln remove OVFFileConverterGUI/OVFFileConverterGUI.csproj | |
| dotnet build --configuration Release | |
| - name: Nuget Deploy | |
| run: | | |
| $env:RELEASE_VERSION=($env:GITHUB_REF).split("tags/v")[-1] | |
| echo $env:RELEASE_VERSION | |
| echo $env:GITHUB_SHA | |
| mkdir nupkg | |
| dotnet pack -p:PackageVersion=$env:RELEASE_VERSION -o $PWD\nupkg -p:RepositoryCommit=$env:GITHUB_SHA --configuration Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
| cd nupkg | |
| dotnet nuget push "**/*.nupkg" --api-key ${{secrets.NUGET_DEPLOY_KEY}} --source "https://api.nuget.org/v3/index.json" --skip-duplicate | |
| publish_docker: | |
| needs: [check_license, build_and_test] | |
| if: startsWith(github.ref, 'refs/tags/v') # make sure deploy only runs on tags with version number | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Set env | |
| run: | | |
| echo "RELEASE_VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV | |
| echo $RELEASE_VERSION | |
| - name: Build container | |
| run: docker build . -t digitalproductionaachen/ovf-grpc:$RELEASE_VERSION | |
| - name: Push container | |
| run: | | |
| echo ${{secrets.DOCKER_HUB_DEPLOY_KEY}} | docker login --username ${{secrets.DOCKER_HUB_USER}} --password-stdin | |
| docker push digitalproductionaachen/ovf-grpc:$RELEASE_VERSION | |
| docker tag digitalproductionaachen/ovf-grpc:$RELEASE_VERSION digitalproductionaachen/ovf-grpc:latest | |
| docker push digitalproductionaachen/ovf-grpc:latest |