Skip to content

Commit

Permalink
automation
Browse files Browse the repository at this point in the history
  • Loading branch information
Haik committed Oct 14, 2023
1 parent 12cb9b2 commit 396b7f0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Deploy NuGet Package

env:
DOTNET_VERSION: '7.x.x'
PROJECT_PATH: './Pandatech.Crypto/Pandatech.Crypto.csproj'
OUTPUT_DIR: 'nupkgs'
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

on:
push:
branches:
Expand All @@ -10,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.x.x' ]
dotnet-version: [ ${{ env.DOTNET_VERSION }} ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,13 +28,13 @@ jobs:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Build
run: dotnet build ./Pandatech.Crypto/Pandatech.Crypto.csproj
run: dotnet build ${{ env.PROJECT_PATH }}

- name: Test
run: dotnet test ./Pandatech.Crypto/Pandatech.Crypto.csproj --collect:"XPlat Code Coverage"
run: dotnet test ${{ env.PROJECT_PATH }} --collect:"XPlat Code Coverage"

- name: Pack
run: dotnet pack ./Pandatech.Crypto/Pandatech.Crypto.csproj --output nupkgs
run: dotnet pack ${{ env.PROJECT_PATH }} --output ${{ env.OUTPUT_DIR }}

- name: Publish
run: dotnet nuget push ./nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
run: dotnet nuget push ${{ env.OUTPUT_DIR }}/*.nupkg -k ${{ env.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE }}

0 comments on commit 396b7f0

Please sign in to comment.