Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Pirngruber committed Jul 8, 2024
2 parents 922ad9e + 056a0e5 commit 812a536
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: CI

on:
push:
tags:
- v*
branches:
- main
pull_request:
branches:
- main

jobs:
build:
env:
BUILD_CONFIG: 'Release'
VERSION: '0.0.0'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration $BUILD_CONFIG --no-restore /p:Version=$VERSION
- name: Create NuGet package
run: dotnet pack --configuration $BUILD_CONFIG --no-restore --no-build /p:PackageVersion=$VERSION
- name: Publish NuGet package
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{secrets.NUGET_API_KEY}}

0 comments on commit 812a536

Please sign in to comment.