Skip to content

Commit

Permalink
Dependabot -> Renovatebot
Browse files Browse the repository at this point in the history
  • Loading branch information
soenneker committed Nov 16, 2023
1 parent 3d40730 commit 98362e5
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 24 deletions.
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"prHourlyLimit": 0,
"autoApprove": true
}
14 changes: 4 additions & 10 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
name: Dependabot auto-merge
name: automerge
on: pull_request

permissions:
contents: write
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:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -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 .
2 changes: 1 addition & 1 deletion .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reenable-automerge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Re-enable automerge
name: reenable-automerge
on:
pull_request:
branches: [main]
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions Soenneker.Utils.MemoryStream.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 98362e5

Please sign in to comment.