Skip to content

Commit d49a3f0

Browse files
authored
new release strategy (#784)
* add draft * nuget when release * no release
1 parent 2ad5b96 commit d49a3f0

File tree

2 files changed

+50
-11
lines changed

2 files changed

+50
-11
lines changed

.github/workflows/draft.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Nuget
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
draft:
9+
10+
runs-on: windows-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: .NET Core 3.1.x SDK
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: 3.1.x
21+
22+
- name: .NET 5.x SDK
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: 5.0.x
26+
27+
- name: .NET 6.x SDK
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: 6.0.x
31+
32+
- name: dotnet restore
33+
run: dotnet restore --verbosity minimal --configfile nuget.config
34+
35+
- name: dotnet test
36+
run: dotnet test
37+
38+
- name: dotnet pack
39+
run: dotnet pack -c Release src/KubernetesClient -o pkg --include-symbols
40+
41+
- name: create release
42+
shell: pwsh
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
$VERSION = Get-ChildItem -Path pkg/*.nupkg -Name | Select-String -Pattern '\d+.\d+.\d+' | foreach {$_.Matches.Value}
47+
gh release create -d --generate-notes $VERSION

.github/workflows/nuget.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Nuget
22

33
on:
4-
push:
5-
branches: [ master ]
4+
release:
5+
types: [ released ]
66

77
jobs:
8-
build:
8+
nuget:
99

1010
runs-on: windows-latest
1111

@@ -40,11 +40,3 @@ jobs:
4040

4141
- name: dotnet nuget push
4242
run: dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }}
43-
44-
- name: create release
45-
shell: pwsh
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
run: |
49-
$VERSION = Get-ChildItem -Path pkg/*.nupkg -Name | Select-String -Pattern '\d+.\d+.\d+' | foreach {$_.Matches.Value}
50-
gh release create --generate-notes $VERSION

0 commit comments

Comments
 (0)