Skip to content

Commit 3b3be6b

Browse files
committed
Updated Github workflow to publish packages.
1 parent c2cc7df commit 3b3be6b

File tree

8 files changed

+61
-5
lines changed

8 files changed

+61
-5
lines changed

.github/workflows/build-test.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- 'main'
7+
tags:
8+
- 'v*'
79
pull_request:
810
branches:
911
- 'main'
@@ -44,9 +46,54 @@ jobs:
4446
# directory: ./test-results
4547
# files: '*.cobertura.xml'
4648
#
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: artifacts
53+
path: ./artifacts
4754
- name: Upload test results
4855
uses: actions/upload-artifact@v3
4956
with:
5057
name: test-results
5158
path: ./test-results
5259
if: ${{ always() }} # Always run this step even on failure
60+
61+
deploy-testing:
62+
if: github.event_name == 'push'
63+
runs-on: ubuntu-latest
64+
environment: testing
65+
needs: build
66+
steps:
67+
- name: Setup .NET
68+
uses: actions/setup-dotnet@v3
69+
with:
70+
dotnet-version: |
71+
8.0.x
72+
- name: Download artifacts
73+
uses: actions/download-artifact@v3
74+
with:
75+
name: artifacts
76+
path: ./artifacts
77+
- name: Push packages
78+
run: dotnet nuget push -s ${{vars.MYGET_URL}} -k ${{secrets.MYGET_API_KEY}} ./artifacts/*.*nupkg
79+
80+
deploy-release:
81+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
82+
runs-on: ubuntu-latest
83+
environment: production
84+
needs:
85+
- build
86+
- deploy-testing
87+
steps:
88+
- name: Setup .NET
89+
uses: actions/setup-dotnet@v3
90+
with:
91+
dotnet-version: |
92+
8.0.x
93+
- name: Download artifacts
94+
uses: actions/download-artifact@v3
95+
with:
96+
name: artifacts
97+
path: ./artifacts
98+
- name: Push packages
99+
run: dotnet nuget push -s ${{vars.NUGET_URL}} -k ${{secrets.NUGET_API_KEY}} ./artifacts/*.*nupkg

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project>
22
<PropertyGroup>
33
<Authors>Christian Prochnow and Contributors</Authors>
4-
<Product>Kubernetes .NET SDK</Product>
4+
<Product>Kubernetes SDK for .NET</Product>
55
<Copyright>Copyright (c) 2023 Christian Prochnow and Contributors</Copyright>
6-
<Description>.NET SDK for the Kubernetes open source container orchestrator.</Description>
76
<Version>1.0.0</Version>
87
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
8+
<PackageTags>Kubernetes;SDK</PackageTags>
99
<LangVersion>latest</LangVersion>
1010
<Nullable>enable</Nullable>
1111

src/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1717
</PackageReference>
18+
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0">
19+
<PrivateAssets>all</PrivateAssets>
20+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21+
</PackageReference>
1822
</ItemGroup>
1923

2024
<ItemGroup>

src/KubernetesSdk.Client.Extensions.DependencyInjection/KubernetesSdk.Client.Extensions.DependencyInjection.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
55
<RootNamespace>Kubernetes.Client</RootNamespace>
6+
<Description>Integrates the client library with Microsoft.Extensions.DepdendencyInjection.</Description>
7+
<PackageTags>$(PackageTags);Client;Extensions;DependencyInjection</PackageTags>
68
</PropertyGroup>
79

810
<ItemGroup>

src/KubernetesSdk.Client/KubernetesSdk.Client.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
55
<RootNamespace>Kubernetes.Client</RootNamespace>
6+
<Description>Client library for the Kubernetes open source container orchestrator.</Description>
7+
<PackageTags>$(PackageTags);Client</PackageTags>
68
<KubernetesGeneratorOptions>api</KubernetesGeneratorOptions>
79
</PropertyGroup>
810

src/KubernetesSdk.Generator/build/KubernetesSdk.Generator.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.0-rc.1.23421.29">
10+
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.0">
1111
<PrivateAssets>all</PrivateAssets>
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1313
</PackageReference>

src/KubernetesSdk.Models/KubernetesSdk.Models.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
55
<RootNamespace>Kubernetes.Models</RootNamespace>
6-
<Description>.NET API Models for the Kubernetes open source container orchestrator.</Description>
6+
<Description>API Models for the Kubernetes open source container orchestrator.</Description>
7+
<PackageTags>$(PackageTags);Models</PackageTags>
78
<KubernetesGeneratorOptions>model</KubernetesGeneratorOptions>
89
</PropertyGroup>
910

src/KubernetesSdk.Serialization/KubernetesSdk.Serialization.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0</TargetFrameworks>
55
<RootNamespace>Kubernetes.Serialization</RootNamespace>
6-
<Description>.NET Serialization for the Kubernetes open source container orchestrator.</Description>
6+
<Description>Serialization library for the Kubernetes open source container orchestrator.</Description>
77
<KubernetesGeneratorOptions>jsoncontext,yamlcontext</KubernetesGeneratorOptions>
88
</PropertyGroup>
99

0 commit comments

Comments
 (0)