Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Update publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell authored Dec 24, 2021
1 parent 449333d commit e90a2f4
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@ name: Publish

on:
release:
types:
- published
types: [ published ]

jobs:
publish:
build:
runs-on: windows-latest

env:
name: "DragonFruit.Six.Api"
project: "DragonFruit.Six.Api\\DragonFruit.Six.Api.csproj"

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

- name: Setup PowerShell Policy
run: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

- 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: Install .NET 6
run: choco install dotnet-sdk

- 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 e90a2f4

Please sign in to comment.