Skip to content

Commit f6a8fbb

Browse files
committed
测试打包
1 parent a2dd052 commit f6a8fbb

1 file changed

Lines changed: 13 additions & 74 deletions

File tree

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

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

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

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

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-
727
PackOnLinuxX64:
738

749
runs-on: ubuntu-latest
@@ -123,10 +58,12 @@ jobs:
12358
dotnet publish -c Release -r linux-x64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
12459
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-x64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
12560
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
61+
- uses: actions/upload-artifact@v4
62+
name: UploadArtifact
63+
with:
64+
name: linux-x64
65+
path: bin/Release/
66+
retention-days: 1
13067

13168
PackOnLinuxArm64:
13269

@@ -182,7 +119,9 @@ jobs:
182119
dotnet publish -c Release -r linux-arm64 src/MediaConverters/MediaConverters.Tool/MediaConverters.Tool.csproj
183120
dotnet pack --configuration Release /p:RuntimeIdentifier=linux-arm64 src/MediaConverters/MediaConverters.Tool.RuntimeNuGet/MediaConverters.Tool.RuntimeNuGet.csproj
184121
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
122+
- uses: actions/upload-artifact@v4
123+
name: UploadArtifact
124+
with:
125+
name: linux-arm64
126+
path: bin/Release/
127+
retention-days: 1

0 commit comments

Comments
 (0)