Skip to content

尝试使用更低版本的支持 #18

尝试使用更低版本的支持

尝试使用更低版本的支持 #18

name: publish nuget
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
2.0.x
2.1.x
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}
- name: Build with dotnet
run: |
dotnet build package\Lindexi.Package.sln --configuration Release
dotnet pack package\Lindexi.Package.sln --configuration Release --no-build
- 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/lindexi/index.json -Username lindexi -Password ${{ secrets.GITHUB_TOKEN }}
- name: Push generated package to NuGet
run: |
nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}