Skip to content

Commit 257a168

Browse files
publish to packages
1 parent da4920a commit 257a168

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ on:
1010

1111
jobs:
1212

13-
integration-tests:
14-
name: 'Integration tests'
15-
runs-on: ubuntu-20.04
16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Setup .NET
19-
uses: actions/setup-dotnet@v3
20-
with:
21-
dotnet-version: '6.0.x'
22-
2313
linux-build:
24-
name: 'Linux x64'
2514
runs-on: ubuntu-20.04
2615
steps:
2716
- uses: actions/checkout@v4
@@ -36,7 +25,6 @@ jobs:
3625
make test
3726
3827
osx-build:
39-
name: 'OSX x64'
4028
runs-on: macos-13
4129
steps:
4230
- uses: actions/checkout@v4
@@ -53,7 +41,6 @@ jobs:
5341
make test
5442
5543
windows-build:
56-
name: 'Windows x64'
5744
runs-on: windows-latest
5845
steps:
5946
- uses: actions/checkout@v4
@@ -66,9 +53,9 @@ jobs:
6653
dotnet restore
6754
dotnet test -c $env:CONFIGURATION test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
6855
69-
windows-artifacts:
56+
package:
7057
name: 'Windows Artifacts'
71-
needs: windows-build
58+
needs: [windows-build, osx-build, linux-build]
7259
runs-on: windows-latest
7360
steps:
7461

@@ -98,10 +85,27 @@ jobs:
9885
$vsuffix = "--version-suffix"
9986
}
10087
101-
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj --output artifacts -c $env:CONFIGURATION $vsuffix $suffix
88+
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj --output dist -c $env:CONFIGURATION $vsuffix $suffix
10289
10390
- name: Upload artifacts
10491
uses: actions/upload-artifact@v3
10592
with:
10693
name: build-artifacts
107-
path: artifacts/
94+
path: dist/
95+
96+
# Publish NuGet packages when a tag is pushed.
97+
# Tests need to succeed for all components and on all platforms first,
98+
# including having a tag name that matches the version number.
99+
publish-release:
100+
# if: ${{ !github.event.repository.fork && startsWith(github.ref, 'refs/tags/v') }}
101+
needs: package
102+
runs-on: ubuntu-latest
103+
steps:
104+
- name: Download NuGet package artifacts
105+
uses: actions/download-artifact@v4
106+
with:
107+
name: nuget-packages
108+
path: dist
109+
- name: Publish to NuGet
110+
run: |
111+
dotnet nuget push "dist/Confluent.Kafka*.nupkg" --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --api-key ${GITHUB_TOKEN}

0 commit comments

Comments
 (0)