From 73a945212b878a7a5bbf92aa71d9ec9aaa401084 Mon Sep 17 00:00:00 2001 From: bounav Date: Mon, 16 Dec 2024 11:30:47 +0000 Subject: [PATCH] Release github action - Added package info to Spark.AspNetCore.Mvc.csproj --- .github/workflows/ci.yml | 5 +-- .github/workflows/release.yml | 41 +++++++++++++++++++ .../Spark.AspNetCore.Mvc.csproj | 5 +++ src/Spark.sln | 1 + 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3951621c..058314db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,4 @@ jobs: run: | cd src dotnet test --no-build --verbosity normal spark-ci.slnf - - name: Pack - run: | - cd src - dotnet pack spark-pack.slnf + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..26d40e09 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Release to NuGet + +on: + release: + types: [published] + +jobs: + build: + + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: | + cd src + dotnet restore spark-ci.slnf + - name: Build + run: | + cd src + dotnet build --no-restore spark-ci.slnf + - name: Test + run: | + cd src + dotnet test --no-build --verbosity normal spark-ci.slnf + - name: Pack + run: | + cd src + dotnet pack spark-pack.slnf + - name: Push to NuGet + run: | + cd src + dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json + \ No newline at end of file diff --git a/src/Spark.AspNetCore.Mvc/Spark.AspNetCore.Mvc.csproj b/src/Spark.AspNetCore.Mvc/Spark.AspNetCore.Mvc.csproj index d1c09075..9b647486 100644 --- a/src/Spark.AspNetCore.Mvc/Spark.AspNetCore.Mvc.csproj +++ b/src/Spark.AspNetCore.Mvc/Spark.AspNetCore.Mvc.csproj @@ -2,6 +2,11 @@ False ..\SparkKey.snk + True + 1.8.2.0 + 1.8.2.0-alpha + 1.8.2.0-alpha + RobertTheGrey Louis DeJardin https://github.com/SparkViewEngine/ README.md diff --git a/src/Spark.sln b/src/Spark.sln index e894d034..5b0480af 100644 --- a/src/Spark.sln +++ b/src/Spark.sln @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml Directory.Build.props = Directory.Build.props + ..\.github\workflows\release.yml = ..\.github\workflows\release.yml Settings.StyleCop = Settings.StyleCop ..\spark.build = ..\spark.build EndProjectSection