Skip to content

Commit

Permalink
Introduce CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Jul 24, 2023
1 parent 731cc06 commit 9fec09f
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
22 changes: 22 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore
run: dotnet restore
- name: Test
run: dotnet test -c Release --verbosity normal
32 changes: 32 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://acraven.medium.com/a-nuget-package-workflow-using-github-actions-7da8c6557863
name: Upload package to NuGet

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
name: Upload package to NuGet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore
run: dotnet restore
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build
run: dotnet build -c Release --no-restore /p:Version=${VERSION} /p:PackageVersion=${VERSION}
# - name: Test
# run: dotnet test -c Release --no-restore --no-build
- name: Pack
run: dotnet pack -c Release /p:Version=${VERSION} --no-restore
- name: Upload Package
run: dotnet nuget push NPTicket/bin/Release/NPTicket.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN}
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}

0 comments on commit 9fec09f

Please sign in to comment.