Skip to content

Commit 2116260

Browse files
authored
Initial commit
0 parents  commit 2116260

File tree

9 files changed

+225
-0
lines changed

9 files changed

+225
-0
lines changed

.github/release-drafter.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '💥 Breaking Changes'
5+
label: 'breaking'
6+
collapse-after: 5
7+
- title: '🚀 Features'
8+
label: 'feature'
9+
collapse-after: 5
10+
- title: '🐛 Bug Fixes'
11+
label: 'bug'
12+
collapse-after: 5
13+
- title: '🧰 Maintenance'
14+
label: 'maintenance'
15+
collapse-after: 5
16+
- title : '⚡ Performance'
17+
label: 'performance'
18+
collapse-after: 5
19+
- title: '✅ Tests'
20+
label: 'tests'
21+
collapse-after: 5
22+
- title: '📚 Documentation'
23+
label: 'documentation'
24+
collapse-after: 5
25+
26+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
27+
no-changes-template: '- No changes'
28+
29+
version-resolver:
30+
major:
31+
labels:
32+
- 'breaking'
33+
minor:
34+
labels:
35+
- 'feature'
36+
patch:
37+
labels:
38+
- 'bug'
39+
- 'maintenance'
40+
- 'documentation'
41+
42+
template: |
43+
# Changes
44+
45+
$CHANGES
46+
47+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/setup-reminder.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: ⚙️ Please complete repository setup
3+
labels: maintenance
4+
---
5+
6+
Please go to [repository settings](https://github.com/{{owner}}/{{repo}}/settings#merge-button-settings) and configure the following:
7+
8+
- [ ] Automatically delete head branches
9+
- [ ] Allow auto-merge
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
update_release_draft:
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: release-drafter/release-drafter@v6
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/setup.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Initial Repository Setup
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- '.github/workflows/setup.yml'
10+
11+
permissions:
12+
contents: write
13+
issues: write
14+
15+
jobs:
16+
minimal-setup:
17+
if: github.repository != 'EnderModuBot/template'
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Replace placeholders in issue template
25+
env:
26+
OWNER: ${{ github.repository_owner }}
27+
REPO: ${{ github.event.repository.name }}
28+
run: |
29+
sed -i "s|{{owner}}|$OWNER|g" .github/setup-reminder.md
30+
sed -i "s|{{repo}}|$REPO|g" .github/setup-reminder.md
31+
32+
- name: Create setup reminder issue
33+
uses: JasonEtco/create-an-issue@v2
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
filename: .github/setup-reminder.md
38+
39+
- name: Create / update default issue labels
40+
shell: bash
41+
run: |
42+
declare -A labels=(
43+
["breaking"]="d20f48:Breaking changes or backwards-incompatible updates"
44+
["feature"]="2ecc71:New functionality or enhancements"
45+
["maintenance"]="f39c12:Codebase cleanup or non-feature updates"
46+
["performance"]="f1c40f:Performance-related improvements"
47+
["tests"]="1abc9c:Adding or updating tests"
48+
)
49+
50+
for name in "${!labels[@]}"; do
51+
IFS=':' read -r color desc <<< "${labels[$name]}"
52+
53+
# Erstellt das Label, fällt bei 422 (already exists) zurück auf PATCH
54+
status=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
55+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
56+
-H "Accept: application/vnd.github+json" \
57+
-d "{\"name\":\"${name}\",\"color\":\"${color}\",\"description\":\"${desc}\"}" \
58+
"https://api.github.com/repos/${{ github.repository }}/labels")
59+
60+
if [ "$status" = "422" ]; then
61+
curl -s -X PATCH \
62+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
63+
-H "Accept: application/vnd.github+json" \
64+
-d "{\"new_name\":\"${name}\",\"color\":\"${color}\",\"description\":\"${desc}\"}" \
65+
"https://api.github.com/repos/${{ github.repository }}/labels/${name}"
66+
fi
67+
done
68+
69+
- name: Delete this workflow file
70+
run: |
71+
git config --global user.name "setup-bot"
72+
git config --global user.email "setup@github.com"
73+
git rm -f .github/workflows/setup.yml
74+
git rm -f .github/setup-reminder.md
75+
git commit -m "chore: remove setup workflow"
76+
git push

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
exclude: (^|/)requirements.*\.txt$
7+
- id: trailing-whitespace
8+
- id: check-yaml
9+
- id: check-added-large-files

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 EnderModuBot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

setup.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
3+
IF NOT EXIST .venv (
4+
python -m venv .venv
5+
)
6+
7+
CALL .venv\Scripts\activate.bat
8+
9+
pip install --upgrade pip
10+
pip install pre-commit
11+
12+
IF EXIST requirements.txt (
13+
pip install -r requirements.txt
14+
)
15+
16+
pre-commit install
17+
18+
ECHO Setup complete

setup.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ ! -d ".venv" ]; then
6+
python3 -m venv .venv
7+
fi
8+
9+
source .venv/bin/activate
10+
11+
pip install --upgrade pip
12+
pip install pre-commit
13+
14+
if [ -f "requirements.txt" ]; then
15+
pip install -r requirements.txt
16+
fi
17+
18+
pre-commit install
19+
20+
echo "Setup complete"

0 commit comments

Comments
 (0)