Skip to content

Commit

Permalink
update publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Dec 17, 2021
1 parent 1830a21 commit bf8bd85
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@ on:
jobs:
build:
runs-on: windows-latest

env:
name: "DragonFruit.Link"
project: "DragonFruit.Link\\DragonFruit.Link.csproj"

steps:
- name: Checkout
uses: actions/checkout@v2

- 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

0 comments on commit bf8bd85

Please sign in to comment.