From 263b4eadd4fa14ba4be13334f501ebb5e684ec72 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Sun, 1 Aug 2021 14:41:37 +0300 Subject: [PATCH] A PR to attempt automating NUGET releases. --- .circleci/config.yml | 22 ---------------------- .github/workflows/nuget-release.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/nuget-release.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index c1e1f9a..df11da7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,34 +36,12 @@ jobs: curl -s https://raw.githubusercontent.com/codecov/codecov-bash/master/codecov > codecov chmod +x codecov ./codecov -t ${CODECOV_TOKEN} - publish: - docker: - - image: mcr.microsoft.com/dotnet/core/sdk:3.1 - - working_directory: ~/repo - - steps: - - checkout - - run: dotnet restore - - run: dotnet pack --configuration release - - run: - name: Publish nuget package - command: | - cd NRedisTimeSeries - dotnet pack --configuration release --output . - dotnet nuget push *.nupkg -k $NugetKey -s https://api.nuget.org/v3/index.json --skip-duplicate workflows: version: 2 commit: jobs: - build - - publish: - requires: - - build - filters: - branches: - only: master nightly: triggers: diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml new file mode 100644 index 0000000..4389adb --- /dev/null +++ b/.github/workflows/nuget-release.yml @@ -0,0 +1,27 @@ +name: Nuget Release + +on: + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet pack --configuration Release --output . + + - name: Publish to NuGet + uses: rohith/publish-nuget@v2 + with: + PROJECT_FILE_PATH: NRedisTimeSeries/NRedisTimeSeries.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}}