Skip to content

Commit c1af930

Browse files
committed
add release script
1 parent a73e840 commit c1af930

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
- name: Setup .NET Core
99
uses: actions/setup-dotnet@v1
1010
with:
11-
dotnet-version: 6.0.x
11+
dotnet-version: 6.x
1212
- name: Build and Test
1313
run: ./build.ps1

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: release
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-dotnet@v3
12+
with:
13+
dotnet-version: |
14+
6.x
15+
16+
- run: dotnet pack -c Release /p:Version=${GITHUB_REF_NAME#v} -o drop/nuget
17+
18+
- uses: actions/upload-artifact@v3
19+
with:
20+
name: nuget
21+
path: drop/nuget
22+
23+
- run: dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.NUGET_KEY }}" --skip-duplicate --source https://api.nuget.org/v3/index.json

Directory.Build.props

+9
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,14 @@
1212
<!-- Build properties -->
1313
<LangVersion>Latest</LangVersion>
1414
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
15+
16+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
17+
<IncludeSymbols>true</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1520
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\"/>
24+
</ItemGroup>
1625
</Project>

0 commit comments

Comments
 (0)