Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeethnandakumar authored May 13, 2023
1 parent dc2194d commit ebdfb70
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "NuGet Publish"

on:
workflow_dispatch:
push:
tags:
- 'v*'

env:
PROJECT_PATH: './Twileloop.Security/Twileloop.Security.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

jobs:
deploy:
name: 'Spinup'
runs-on: 'ubuntu-latest'

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

- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: 'Restore'
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: 'Build'
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release

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

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

- name: 'Publish'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_ORG_API_KEY }} -s ${{ env.NUGET_SOURCE_URL }}

0 comments on commit ebdfb70

Please sign in to comment.