From 1974bad29900a4bbc852701345f3c3ca3226a1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Sat, 13 Jul 2024 15:38:30 +0200 Subject: [PATCH] Added CI stuff --- .github/dependabot.yml | 7 +++++ .github/workflows/build.yml | 23 ++++++++++++++ .github/workflows/publish-to-nuget.yml | 30 +++++++++++++++++++ .../Nefarius.Peripherals.SerialPort.csproj | 9 ++++++ 4 files changed, 69 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish-to-nuget.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..26138f7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 + +updates: + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c7e401 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: .NET + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup .Net SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.x + + - name: Build + run: dotnet build -c Release diff --git a/.github/workflows/publish-to-nuget.yml b/.github/workflows/publish-to-nuget.yml new file mode 100644 index 0000000..ef43f43 --- /dev/null +++ b/.github/workflows/publish-to-nuget.yml @@ -0,0 +1,30 @@ +name: Publish Nuget Package + +on: + push: + tags: + - v* + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup .Net SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.x + + - name: Build + run: dotnet build -c Release + + - name: Make Nuget Packages + run: dotnet pack -c Release + + - name: Publish To Nuget + run: dotnet nuget push bin/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json + env: + NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} diff --git a/Nefarius.Peripherals.SerialPort/Nefarius.Peripherals.SerialPort.csproj b/Nefarius.Peripherals.SerialPort/Nefarius.Peripherals.SerialPort.csproj index 91af2d0..7efce75 100644 --- a/Nefarius.Peripherals.SerialPort/Nefarius.Peripherals.SerialPort.csproj +++ b/Nefarius.Peripherals.SerialPort/Nefarius.Peripherals.SerialPort.csproj @@ -17,6 +17,11 @@ latest + + + v + + @@ -36,5 +41,9 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + \ No newline at end of file