Extract Kafka Header to CloudEvent #4657
Workflow file for this run
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: .NET | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| merge_group: | |
| types: [checks_requested] | |
| release: | |
| types: | |
| - published | |
| env: | |
| NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
| NUGET_FEED: https://api.nuget.org/v3/index.json | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Install tools | |
| run: dotnet tool restore | |
| - name: check format | |
| run: dotnet csharpier check . | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Install dependencies | |
| run: dotnet restore Motor.NET.slnx | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore Motor.NET.slnx | |
| - name: Pack | |
| run: dotnet pack -v minimal -c Release --no-restore -o ./artifacts Motor.NET.slnx | |
| - name: Publish Bridge | |
| run: dotnet publish --framework net9.0 -v minimal -c Release --no-restore -o ./artifacts-bridge ./src/Motor.Extensions.Hosting.Bridge/Motor.Extensions.Hosting.Bridge.csproj | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts | |
| path: | | |
| ./artifacts/*.nupkg | |
| ./artifacts/*.snupkg | |
| - name: Upload Artifact Bridge | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts-bridge | |
| path: ./artifacts-bridge/* | |
| test-net8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| - name: Install dependencies | |
| run: dotnet restore Motor.NET.slnx | |
| - name: Test .NET8 | |
| run: dotnet test --no-restore Motor.NET.slnx --framework net8.0 | |
| test-net9: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| - name: Install dependencies | |
| run: dotnet restore Motor.NET.slnx | |
| - name: Test .NET9 | |
| run: dotnet test --no-restore Motor.NET.slnx --framework net9.0 | |
| #code-ql: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v2 | |
| # - name: Initialize CodeQL | |
| # uses: github/codeql-action/init@v1 | |
| # with: | |
| # languages: csharp | |
| # - name: Setup .NET | |
| # uses: actions/setup-dotnet@v1 | |
| # with: | |
| # dotnet-version: 7.0.x | |
| # - name: Install dependencies | |
| # run: dotnet restore Motor.NET.slnx | |
| # - name: Build | |
| # run: dotnet build --configuration Release --no-restore Motor.NET.slnx | |
| # - name: Perform CodeQL Analysis | |
| # uses: github/codeql-action/analyze@v1 | |
| deploy: | |
| needs: [build, format, test-net8, test-net9] | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifact | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifacts | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Push to NuGet Feed | |
| run: dotnet nuget push "${{ steps.download.outputs.download-path }}/*.nupkg" --skip-duplicate --source $NUGET_FEED --api-key $NUGET_KEY | |
| build-bridge: | |
| needs: [build, format, test-net8, test-net9] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifact | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifacts-bridge | |
| - name: Prepare | |
| id: prep | |
| run: | | |
| DOCKER_IMAGE=ghcr.io/gdatasoftwareag/motornet/bridge | |
| VERSION=edge | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| elif [[ $GITHUB_REF == refs/heads/* ]]; then | |
| VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') | |
| elif [[ $GITHUB_REF == refs/pull/* ]]; then | |
| VERSION=pr-${{ github.event.number }} | |
| fi | |
| TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${VERSION}-${GITHUB_SHA::8}" | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "tags=${TAGS}" >> $GITHUB_OUTPUT | |
| echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
| - name: Login to Github Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push to GitHub Packages | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: ${{ github.event_name == 'release' }} | |
| context: "${{ steps.download.outputs.download-path }}" | |
| tags: ${{ steps.prep.outputs.tags }} | |
| labels: | | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.created=${{ steps.prep.outputs.created }} |