diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 876d1ec..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -github: shibayan -custom: paypal.me/shibayan \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a4eebc6..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - DOTNET_VERSION: 7.0.x - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Use .NET ${{ env.DOTNET_VERSION }} - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Build project - run: dotnet build -c Release - - - name: Run test cases - run: dotnet test -c Release --no-build - - - name: Lint C# code - run: dotnet format --verify-no-changes --verbosity detailed --no-restore diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..15be999 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,31 @@ +name: Build and publish package + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@master + + - name: Setup .NET environment + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.100' + + - name: Build project + run: dotnet build --configuration Release + + - name: Generate a NuGet package + run: dotnet pack --no-build -c Release -o . + + - name: Push to GitHub package registry + run: dotnet nuget push "*.nupkg" -k ${{secrets.NUGETORGTOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 15db58a..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Publish - -on: - push: - tags: [ v* ] - -env: - DOTNET_VERSION: 7.0.x - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Use .NET ${{ env.DOTNET_VERSION }} - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Setup Version - id: setup_version - run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT - - - name: Pack NuGet Package - run: dotnet pack CsvHelper.FastDynamic/CsvHelper.FastDynamic.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }} - - - name: Publish - run: dotnet nuget push dist/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json