From c01cbaf88637c39d570222fabe923caa02a232fe Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 19 Dec 2024 14:56:18 +0800 Subject: [PATCH] Create dotnet.yml --- .github/workflows/dotnet.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..0e4f215 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,31 @@ +name: Publish .NET Package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0.x' # Change this to the .NET version you are using + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-restore --verbosity normal + - name: Publish + run: dotnet pack --configuration Release --no-build --output ./artifacts + - name: Push to GitHub Packages + run: dotnet nuget push ./artifacts/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/top-gg/index.json --skip-duplicate + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true