From bf8bd85a234f7c6c85b692d4d5db3997482782b6 Mon Sep 17 00:00:00 2001 From: Albie Date: Fri, 17 Dec 2021 20:38:48 +0000 Subject: [PATCH] update publish script --- .github/workflows/publish.yaml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 356696c..97da375 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,10 +7,6 @@ on: jobs: build: runs-on: windows-latest - - env: - name: "DragonFruit.Link" - project: "DragonFruit.Link\\DragonFruit.Link.csproj" steps: - name: Checkout @@ -18,17 +14,25 @@ jobs: - name: Setup PowerShell Policy run: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force - + - name: Install .NET 6 run: choco install dotnet-sdk - - - name: Download Publish Script - run: powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dragonfruitnetwork/publish-script/main/nuget.ps1" -OutFile ".\nuget.ps1" - - name: NuGet Build and Publish (Release) - run: .\nuget.ps1 -TargetName $env:name -TargetProject $env:project -ApiKey ${{ secrets.NUGET_KEY }} - if: "!github.event.release.prerelease" + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build -c Release -v normal -p:Version=${{ github.ref_name }} - - name: Nuget Build and Publish (Beta) - run: .\nuget.ps1 -TargetName $env:name -TargetProject $env:project -ApiKey ${{ secrets.NUGET_KEY }} -Suffix "-beta" + - name: Pack (Beta) + run: dotnet pack -c Release --include-symbols --no-build -v normal -o $env:GITHUB_WORKSPACE -p:PackageVersion=${{ github.ref_name }}-beta if: "github.event.release.prerelease" + + - name: Pack (Stable) + run: dotnet pack -c Release --include-symbols --no-build -v normal -o $env:GITHUB_WORKSPACE -p:PackageVersion=${{ github.ref_name }} + if: "!github.event.release.prerelease" + + - name: Publish + run: | + cd $env:GITHUB_WORKSPACE + dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_KEY }} --skip-duplicate -s https://api.nuget.org/v3/index.json \ No newline at end of file