Skip to content

Commit 13403f2

Browse files
committed
Fix CI
1 parent 9bc68cc commit 13403f2

File tree

3 files changed

+69
-35
lines changed

3 files changed

+69
-35
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
name: .NET Build
1+
name: .NET Build
2+
23
on: [push]
34

45
jobs:
56
build:
6-
name: Build
7+
78
runs-on: windows-latest
9+
810
steps:
9-
- name: Checkout
10-
uses: actions/checkout@v2
11-
- name: Setup
12-
uses: actions/setup-dotnet@v1
13-
- name: Build
14-
run: dotnet build --configuration Release
15-
- name: Test
16-
run: dotnet test
11+
- uses: actions/checkout@v1
12+
- name: Setup .NET
13+
uses: actions/setup-dotnet@v1
14+
with:
15+
dotnet-version: |
16+
8.0.x
17+
9.0.x
18+
19+
- name: Build
20+
run: dotnet build -c release
21+
22+
- name: Test Debug
23+
run: dotnet test -c debug
24+
25+
- name: Test Release
26+
run: dotnet test -c release
27+
28+
- name: Pack
29+
run: dotnet pack ./src/DotNetCampus.WeChatWork -c release --no-build

.github/workflows/nuget-publish.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: NuGet Package
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: |
20+
8.0.x
21+
9.0.x
22+
23+
- name: Install dotnet tool
24+
run: dotnet tool install -g dotnetCampus.TagToVersion
25+
26+
- name: Set tag to version
27+
run: dotnet TagToVersion -t ${{ github.ref }}
28+
29+
- name: Build with dotnet
30+
run: |
31+
dotnet build -c release
32+
dotnet pack ./src/DotNetCampus.WeChatWork -c release --no-build
33+
34+
- name: Install Nuget
35+
uses: nuget/setup-nuget@v1
36+
with:
37+
nuget-version: '6.x'
38+
39+
- name: Add private GitHub registry to NuGet
40+
run: |
41+
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Push generated package to GitHub registry
44+
run: |
45+
nuget push .\artifacts\package\release\*.nupkg -Source github -SkipDuplicate
46+
nuget push .\artifacts\package\release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}

0 commit comments

Comments
 (0)