From 09502fc611fd7fd67a1b290c44497a565313a59e Mon Sep 17 00:00:00 2001 From: "Vignesh.N" Date: Fri, 6 Nov 2020 12:12:46 +0000 Subject: [PATCH] create build and release workflows --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ Spry/Spry.csproj | 6 +++--- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c45da0c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Checkout Repository + + - name: Use .NET Core 3.1.301 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + + - name: dotnet restore + run: dotnet restore /nologo + + - name: dotnet build + run: dotnet build -c Release --no-restore --nologo diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d9c2256 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + release: + types: [published] + +jobs: + publish_nuget: + if: ${{ github.event.release.target_commitish == 'master' && !github.event.release.draft}} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Checkout Repository + + - name: Use .NET Core 3.1.301 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + + - name: dotnet restore + run: dotnet restore /nologo + + - name: dotnet build & pack + run: | + dotnet build -c Release --no-restore --nologo + dotnet pack Spry/Spry.csproj -c Release --no-build --nologo -o package + + - name: dotnet push to NuGet + working-directory: package + run: | + dotnet nuget push ${PACKAGE_NAME} --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json + env: + PACKAGE_NAME: ${{ format('Spry.{0}.nupkg', github.event.release.tag_name) }} + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/Spry/Spry.csproj b/Spry/Spry.csproj index af3bb97..df68c41 100644 --- a/Spry/Spry.csproj +++ b/Spry/Spry.csproj @@ -2,14 +2,14 @@ netstandard20 - 1.0.4 + 1.0.6 Vignesh.N - https://github.com/vigneshmsft/Spry/blob/master/LICENSE + https://github.com/vigneshmsft/Spry/blob/master/LICENSE https://github.com/vigneshmsft/Spry https://github.com/vigneshmsft/Spry dapper spry database micro-orm orm sql-server sql query-builder fluent-query-builder query dapper-extensions Spry - fluent CRUD queries using Dapper - v1.0.4 updating to .NET Standard. + v1.0.6