Skip to content

Commit 50feca9

Browse files
committed
Revert "测试打包"
This reverts commit f6a8fbb.
1 parent 881e280 commit 50feca9

1 file changed

Lines changed: 74 additions & 13 deletions

File tree

.github/workflows/NuGet-tag-publish-MediaConverters.yml

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,74 @@
11
name: Publish MediaConverters NuGet
22

3-
on: [push]
3+
on:
4+
push:
5+
tags:
6+
- '*'
47

58
jobs:
9+
PackOnWindows:
10+
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
615

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: dotnet build --configuration Release src\MediaConverters\MediaConverters.sln
24+
25+
- name: Pack MediaConverters.Tool.ContextNuGet
26+
run: dotnet pack --no-build true --configuration Release src\MediaConverters\MediaConverters.Tool.ContextNuGet\MediaConverters.Tool.ContextNuGet.csproj
27+
28+
- name: Pack DotNetCampus.MediaConverter.SkiaWmfRenderer
29+
run: dotnet pack --no-build true --configuration Release src\MediaConverters\SkiaWmfRenderer\src\SkiaWmfRenderer\SkiaWmfRenderer.csproj
30+
31+
- name: Publish and Pack win-x86
32+
run: |
33+
dotnet publish -c Release -r win-x86 src\MediaConverters\MediaConverters.Tool\MediaConverters.Tool.csproj
34+
dotnet pack --configuration Release /p:RuntimeIdentifier=win-x86 src\MediaConverters\MediaConverters.Tool.RuntimeNuGet\MediaConverters.Tool.RuntimeNuGet.csproj
35+
36+
- name: Publish and Pack win-x64
37+
run: |
38+
dotnet publish -c Release -r win-x64 src\MediaConverters\MediaConverters.Tool\MediaConverters.Tool.csproj
39+
dotnet pack --configuration Release /p:RuntimeIdentifier=win-x64 src\MediaConverters\MediaConverters.Tool.RuntimeNuGet\MediaConverters.Tool.RuntimeNuGet.csproj
40+
41+
- name: Push generated package to NuGet
42+
run: |
43+
dotnet nuget push .\bin\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
44+
dotnet nuget push .\bin\Release\*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} --api-key ${{ secrets.GITHUB_TOKEN }} --timeout 3000
45+
46+
PackOnWindowsArm64:
47+
48+
runs-on: windows-11-arm
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Install dotnet tool
54+
run: dotnet tool install -g dotnetCampus.TagToVersion
55+
56+
- name: Set tag to version
57+
run: dotnet TagToVersion -t ${{ github.ref }}
58+
59+
- name: Build with dotnet
60+
run: dotnet build --configuration Release src\MediaConverters\MediaConverters.sln
61+
62+
- name: Publish and Pack win-arm64
63+
run: |
64+
dotnet publish -c Release -r win-arm64 src\MediaConverters\MediaConverters.Tool\MediaConverters.Tool.csproj
65+
dotnet pack --configuration Release /p:RuntimeIdentifier=win-arm64 src\MediaConverters\MediaConverters.Tool.RuntimeNuGet\MediaConverters.Tool.RuntimeNuGet.csproj
66+
67+
- name: Push generated package to NuGet
68+
run: |
69+
dotnet nuget push .\bin\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
70+
dotnet nuget push .\bin\Release\*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} --api-key ${{ secrets.GITHUB_TOKEN }} --timeout 3000
71+
772
PackOnLinuxX64:
873

974
runs-on: ubuntu-latest
@@ -58,12 +123,10 @@ jobs:
58123
dotnet publish -c Release -r linux-x64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
59124
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-x64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
60125
61-
- uses: actions/upload-artifact@v4
62-
name: UploadArtifact
63-
with:
64-
name: linux-x64
65-
path: bin/Release/
66-
retention-days: 1
126+
- name: Push generated package to NuGet
127+
run: |
128+
dotnet nuget push ./bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
129+
dotnet nuget push ./bin/Release/*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} --api-key ${{ secrets.GITHUB_TOKEN }} --timeout 3000
67130
68131
PackOnLinuxArm64:
69132

@@ -119,9 +182,7 @@ jobs:
119182
dotnet publish -c Release -r linux-arm64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
120183
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-arm64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
121184
122-
- uses: actions/upload-artifact@v4
123-
name: UploadArtifact
124-
with:
125-
name: linux-arm64
126-
path: bin/Release/
127-
retention-days: 1
185+
- name: Push generated package to NuGet
186+
run: |
187+
dotnet nuget push ./bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NugetKey }}
188+
dotnet nuget push ./bin/Release/*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} --api-key ${{ secrets.GITHUB_TOKEN }} --timeout 3000

0 commit comments

Comments
 (0)