Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaben committed Sep 20, 2024
2 parents 58a2e2e + 914af0f commit fe9e2f5
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push to Nuget

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [8.x]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true

- name: Pack
run: dotnet pack -c Release -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg

- name: Publish
if: github.event_name != 'pull_request' && (github.ref_name == 'master')
run: |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate
dotnet nuget push **/*.snupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate

0 comments on commit fe9e2f5

Please sign in to comment.