diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index bc18f008..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "nuget" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..370db06c --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "automerge": true, + "prHourlyLimit": 0, + "autoApprove": true +} diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index c4d3dae3..057a2033 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,4 +1,4 @@ -name: Dependabot auto-merge +name: automerge on: pull_request permissions: @@ -6,19 +6,13 @@ permissions: pull-requests: write env: - GH_TOKEN: ${{ secrets.DEPENDABOT }} + GH_TOKEN: ${{ secrets.RENOVATEBOT }} jobs: - dependabot: + automerge: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: ${{ github.actor == 'renovate[bot]' }} steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - - name: Enable auto-merge for Dependabot PRs run: gh pr merge --auto --merge "$PR_URL" env: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..70d4f052 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,30 @@ +name: build-and-test +on: + # Testing - run for any PRs. + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test test/Soenneker.Utils.MemoryStream.Tests.csproj --no-restore --verbosity normal + + - name: Pack + run: dotnet pack --no-build --configuration Release --output . diff --git a/.github/workflows/buildandtest.yml b/.github/workflows/buildandtest.yml index 96915db5..0d1f9b24 100644 --- a/.github/workflows/buildandtest.yml +++ b/.github/workflows/buildandtest.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET 8.0 uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 00000000..df994929 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,40 @@ +name: publish-package +on: + push: + branches: + - main + + # Publish `v1.2.3` tags as releases. + tags: + - v* +jobs: + + publish-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setting up build version + run: | + version=$(($GITHUB_RUN_NUMBER)) + echo "BUILD_VERSION=2.0.$version" >> ${GITHUB_ENV} + + - name: Setup .NET Core 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test test/Soenneker.Utils.MemoryStream.Tests.csproj --no-restore --verbosity normal + + - name: Pack + run: dotnet pack --no-build --configuration Release --output . + + - name: Publish to nuGet + run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f1bf8caa..ad79e428 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET 8.0 uses: actions/setup-dotnet@v3 diff --git a/.github/workflows/reenable-automerge.yml b/.github/workflows/reenable-automerge.yml index 7aa58252..649de3b0 100644 --- a/.github/workflows/reenable-automerge.yml +++ b/.github/workflows/reenable-automerge.yml @@ -1,4 +1,4 @@ -name: Re-enable automerge +name: reenable-automerge on: pull_request: branches: [main] @@ -10,7 +10,7 @@ permissions: pull-requests: write jobs: - main: + reenable-automerge: if: "github.event.reason == 'Base branch was modified'" runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 8e60d8aa..c4d67bd5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![](https://img.shields.io/nuget/v/Soenneker.Utils.MemoryStream.svg?style=for-the-badge)](https://www.nuget.org/packages/Soenneker.Utils.MemoryStream/) -[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.memorystream/publish.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.utils.memorystream/actions/workflows/publish.yml) +[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.memorystream/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.utils.memorystream/actions/workflows/publish-package.yml) [![](https://img.shields.io/nuget/dt/Soenneker.Utils.MemoryStream.svg?style=for-the-badge)](https://www.nuget.org/packages/Soenneker.Utils.MemoryStream/) # ![](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Utils.MemoryStream diff --git a/Soenneker.Utils.MemoryStream.sln b/Soenneker.Utils.MemoryStream.sln index 9722faaf..9ee94c8d 100644 --- a/Soenneker.Utils.MemoryStream.sln +++ b/Soenneker.Utils.MemoryStream.sln @@ -6,14 +6,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soenneker.Utils.MemoryStrea EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{4E42254D-039C-40ED-B3F4-8C1A94A366D1}" ProjectSection(SolutionItems) = preProject - .github\dependabot.yml = .github\dependabot.yml + .github\renovate.json = .github\renovate.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{D786EC1A-4F59-412F-8624-83E6E3525B0C}" ProjectSection(SolutionItems) = preProject .github\workflows\automerge.yml = .github\workflows\automerge.yml - .github\workflows\buildandtest.yml = .github\workflows\buildandtest.yml - .github\workflows\publish.yml = .github\workflows\publish.yml + .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml + .github\workflows\publish-package.yml = .github\workflows\publish-package.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Soenneker.Utils.MemoryStream.Tests", "test\Soenneker.Utils.MemoryStream.Tests.csproj", "{6456E465-9523-4612-9115-9D9B585B42E8}"