Skip to content

Commit dc3f851

Browse files
authored
Merge pull request #2 from dotnet-campus/t/lindexi/CI
加上自动打包
2 parents 3d5292e + 355ea69 commit dc3f851

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: .NET Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v5
12+
13+
- name: Build with dotnet
14+
run: dotnet build --configuration release
15+
# - name: Test
16+
# run: dotnet test --configuration release --no-build
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: publish nuget
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@v5
15+
16+
- name: Install dotnet tool
17+
run: dotnet tool install -g dotnetCampus.TagToVersion
18+
19+
- name: Set tag to version
20+
run: dotnet TagToVersion -t ${{ github.ref }}
21+
22+
- name: Build with dotnet
23+
run: |
24+
dotnet build --configuration release
25+
dotnet pack --configuration release --no-build src\dotnetCampus.CodeAnalysisUtils\DotNetCampus.CodeAnalysisUtils.csproj
26+
27+
- name: Push generated package to NuGet
28+
run: |
29+
dotnet nuget push .\artifacts\package\release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
30+
dotnet nuget push .\artifacts\package\release\*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} --api-key ${{ secrets.GITHUB_TOKEN }} --timeout 3000

tests/DotNetCampus.CodeAnalysis.Tests/DotNetCampus.CodeAnalysis.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<RootNamespace>DotNetCampus.CodeAnalysis.Tests</RootNamespace>
66
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
77
<IsRoslynComponent>true</IsRoslynComponent>
8+
<IsPackable>false</IsPackable>
9+
<IsTestProject>true</IsTestProject>
810
</PropertyGroup>
911

1012
<ItemGroup>

0 commit comments

Comments
 (0)