Skip to content

Commit

Permalink
Merge pull request #19 from tyronbrand/nuget-deploy-workflow
Browse files Browse the repository at this point in the history
deploy SDK to NuGet via action (ci-cd)
  • Loading branch information
tyronbrand authored Oct 21, 2021
2 parents 95ba46a + 8d6119e commit aa80ad7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/SDK-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Deploy to NuGet"

on:
push:
branches: [ main ]
tags:
- 'v*'

env:
PROJECT_PATH: 'src/Flow.Net.SDK/Flow.Net.Sdk.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

jobs:
deploy:
name: 'Deploy'
runs-on: 'windows-latest'
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: 'Get Version'
id: version
uses: battila7/get-version-action@v2

- name: Test
run: dotnet test

- name: 'Pack project'
run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: 'Push package'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}

0 comments on commit aa80ad7

Please sign in to comment.