Skip to content

Commit

Permalink
ci: add some basic workflow and renovate config
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Nov 24, 2024
1 parent 4ba6075 commit 0c1ae92
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @tboerger
49 changes: 49 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":semanticCommits",
":semanticCommitType(deps)"
],
"packageRules": [
{
"description": "Semantic commits for major updates",
"matchUpdateTypes": [
"major"
],
"semanticCommitType": "major",
"semanticCommitScope": "deps",
"automerge": true
},
{
"description": "Semantic commits for minor updates",
"matchUpdateTypes": [
"minor"
],
"semanticCommitType": "minor",
"semanticCommitScope": "deps",
"automerge": true
},
{
"description": "Semantic commits for patch updates",
"matchUpdateTypes": [
"patch"
],
"semanticCommitType": "patch",
"semanticCommitScope": "deps",
"automerge": true
},
{
"description": "Build tool version upgrades",
"matchManagers": [
"github-actions"
],
"semanticCommitType": "ci",
"semanticCommitScope": "tools",
"automerge": true
}
],
"labels": [
"renovate"
]
}
19 changes: 17 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repository:

default_branch: master

allow_squash_merge: true
allow_merge_commit: true
allow_squash_merge: false
allow_merge_commit: false
allow_rebase_merge: true

labels:
Expand Down Expand Up @@ -48,4 +48,19 @@ labels:
color: cccccc
description: Accepted as a Hacktoberfest submission

branches:
- name: master
protection:
required_pull_request_reviews: null
required_status_checks:
strict: true
contexts:
- check
enforce_admins: false
restrictions:
apps:
- renovate
users: []
teams: []

...
38 changes: 38 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: automerge

"on":
workflow_dispatch:
pull_request:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Approve request
id: approve
run: gh pr review --approve "${{github.event.pull_request.html_url}}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable automerge
id: automerge
run: gh pr merge --rebase --auto "${{github.event.pull_request.html_url}}"
env:
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}

...
18 changes: 18 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: general

"on":
pull_request:
push:
branches:
- master

jobs:
check:
runs-on: macos-latest

steps:
- name: Clone source
uses: actions/checkout@v4

...
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: release

"on":
workflow_dispatch:
schedule:
- cron: "0 8 * * 1"

permissions:
contents: read
id-token: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}

- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install releaser
run: |
npm install -g \
conventional-changelog-conventionalcommits@6.1.0 \
semantic-release@23.1.1 \
@semantic-release/changelog \
@semantic-release/git
- name: Run releaser
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: semantic-release

- name: Write buildtime
run: date >| .github/RELEASE

- name: Update repo
run: git pull --rebase --autostash

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: thomas@webhippie.de
add: .github/RELEASE
message: "docs: automated release update [skip ci]"
push: true
commit: --signoff

...

0 comments on commit 0c1ae92

Please sign in to comment.