Skip to content

Commit

Permalink
Publish Preview to NuGet
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaldoumas committed Nov 24, 2021
1 parent 6ad74bf commit 87dfaba
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-preview.yml
@@ -0,0 +1,35 @@
name: Publish Preview to NuGet

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-preview-[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha-[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta-[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-prerelease-[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc-[0-9]+"

jobs:
publish_preview:

runs-on: ubuntu-latest
environment: "Publish Preview"

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Restore Dependencies
run: dotnet restore src
- name: Build
run: dotnet build src --configuration Release --no-restore
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack NuGet
run: dotnet pack src --no-build --configuration Release /p:Version=${VERSION} --output src
- name: Publish NuGet
run: dotnet nuget push src/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY} --skip-duplicate
env:
NUGET_KEY: ${{ secrets.PREVIEW_NUGET_API_KEY }}

0 comments on commit 87dfaba

Please sign in to comment.