forked from confluentinc/confluent-kafka-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
CI/CD script for librdkafka v2.10.0-gr #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marcin-krystianc
merged 2 commits into
G-Research:2.10.0-gr
from
marcin-krystianc:dev-20250429-v2.10.0
Apr 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: 'confluent-kafka-dotnet build pipeline' | ||
|
||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 'true' | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
build-test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-13] # macos-13 for x86_x64 arch | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
8.0.x | ||
- name: Build and test | ||
run: | | ||
dotnet nuget add source --username user --password ${{ github.token }} --store-password-in-clear-text --name github https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
dotnet restore | ||
dotnet test -c Release test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
marcin-krystianc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
package: | ||
needs: [build-test] | ||
runs-on: windows-latest | ||
steps: | ||
|
||
- name: Show default environment variables | ||
run: | | ||
echo "The job_id is: $GITHUB_JOB" # reference the default environment variables | ||
echo "The id of this action is: $GITHUB_ACTION" # reference the default environment variables | ||
echo "The run id is: $GITHUB_RUN_ID" | ||
echo "The GitHub Actor's username is: $GITHUB_ACTOR" | ||
echo "GitHub SHA: $GITHUB_SHA" | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
8.0.x | ||
- name: Build and create packages | ||
run: | | ||
dotnet restore | ||
dotnet build Confluent.Kafka.sln -c Release | ||
|
||
# Different packaging for tagged vs untagged builds | ||
if ($env:GITHUB_REF -match '^refs/tags/') { | ||
$suffix = "gr" | ||
} else { | ||
$suffix = "ci-$env:GITHUB_RUN_ID" | ||
} | ||
|
||
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj --output dist -c Release --version-suffix $suffix | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist/ | ||
|
||
# Publish NuGet packages when a tag is pushed. | ||
# Tests need to succeed for all components and on all platforms first, | ||
# including having a tag name that matches the version number. | ||
publish-release: | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
needs: package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download NuGet package artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist | ||
- name: Publish to NuGet | ||
run: | | ||
dotnet nuget push "dist/Confluent.Kafka*.nupkg" --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${GITHUB_TOKEN} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.