Skip to content

Commit 702a8b6

Browse files
committed
尝试测试发布版本
1 parent 2a49abe commit 702a8b6

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: publish nuget
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
PackOnWindows:
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+
3.1.x
21+
5.0.x
22+
6.0.x
23+
9.0.x
24+
25+
- name: Install dotnet tool
26+
run: dotnet tool install -g dotnetCampus.TagToVersion
27+
28+
- name: Set tag to version
29+
run: dotnet TagToVersion -t ${{ github.ref }}
30+
31+
- name: Build with dotnet
32+
run: dotnet build --configuration Release src\MediaConverters\MediaConverters.sln
33+
34+
- name: Publish and Pack win-x86
35+
run: |
36+
dotnet publish -c Release -r win-x86 src\MediaConverters\MediaConverters.Tool\MediaConverters.Tool.csproj
37+
dotnet pack --configuration Release /p:RuntimeIdentifier=win-x86 src\MediaConverters\MediaConverters.RuntimeNuGet\MediaConverters.RuntimeNuGet.csproj
38+
39+
- name: Publish and Pack win-x64
40+
run: |
41+
dotnet publish -c Release -r win-x64 src\MediaConverters\MediaConverters.Tool\MediaConverters.Tool.csproj
42+
dotnet pack --configuration Release /p:RuntimeIdentifier=win-x64 src\MediaConverters\MediaConverters.RuntimeNuGet\MediaConverters.RuntimeNuGet.csproj
43+
44+
- name: Add private GitHub registry to NuGet
45+
run: |
46+
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Push generated package to NuGet
49+
run: |
50+
dotnet nuget push .\bin\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
51+
dotnet nuget push .\bin\Release\*.nupkg -s github

src/MediaConverters/MediaConverters.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{208BA388-4CEE-2CBF-559C-5607C099C1F8}"
1313
ProjectSection(SolutionItems) = preProject
1414
..\..\.github\workflows\MediaConverters.yml = ..\..\.github\workflows\MediaConverters.yml
15+
..\..\.github\workflows\NuGet-tag-publish-MediaConverters.yml = ..\..\.github\workflows\NuGet-tag-publish-MediaConverters.yml
1516
README.md = README.md
1617
README.zh-cn.md = README.zh-cn.md
1718
EndProjectSection

0 commit comments

Comments
 (0)