Skip to content

Commit

Permalink
同步修改Tag打包使用私有服务器
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Dec 6, 2023
1 parent e566125 commit e2daaba
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/NuGet-Tag-Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:

Build:

runs-on: windows-latest
runs-on: [self-hosted, VSPreview] # 现在只有私有服务器才能打包成功
# runs-on: windows-latest

steps:
- uses: actions/checkout@v1
Expand All @@ -36,27 +37,29 @@ jobs:
dotnet-version: |
3.1.x
5.0.x
6.0.101
6.0.x
- name: Install Tools
run: dotnet tool install -g dotnetCampus.TagToVersion --add-source https://api.nuget.org/v3/index.json
- name: Set Package TagToVersion
run: dotnet tagtoversion -t ${{ github.ref }} -f CustomWpf\build\Version.props

- name: Build WPF
run: .\build.cmd -pack -ci -configuration Release -prepareMachine /p:Platform=x86

- name: Pack NuGet
run: dotnet pack CustomWpf -c release

- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Add private GitHub registry to NuGet
run: |
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
# - name: Add private GitHub registry to NuGet
# run: |
# nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet Package
run: |
nuget push .\CustomWpf\bin\Release\*.nupkg -Source github -SkipDuplicate
nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
run: nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
# nuget push .\CustomWpf\bin\Release\*.nupkg -Source github -SkipDuplicate
# nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}

# - name: Push
# uses: actions/upload-artifact@v1
Expand Down

0 comments on commit e2daaba

Please sign in to comment.