Initial commit
This commit is contained in:
114
workflows/changelog_config.json
Normal file
114
workflows/changelog_config.json
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"categories": [
|
||||
{
|
||||
"title": "## 🚀 Features",
|
||||
"labels": [
|
||||
"add",
|
||||
"Add",
|
||||
"Kind/Feature",
|
||||
"feat",
|
||||
"Feature",
|
||||
"Feat"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🧰 Enhancements",
|
||||
"labels": [
|
||||
"enhancement",
|
||||
"Enhancement",
|
||||
"Kind/Enhancement",
|
||||
"improvement",
|
||||
"Improvement",
|
||||
"Kind/Improvement"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🐛 Fixes",
|
||||
"labels": [
|
||||
"fix",
|
||||
"Fix",
|
||||
"Kind/Bug",
|
||||
"Kind/Security"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🧪 Upgrade",
|
||||
"labels": [
|
||||
"upgrade",
|
||||
"Upgrade",
|
||||
"Clean"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 📝 Documentation",
|
||||
"labels": [
|
||||
"docs",
|
||||
"Docs",
|
||||
"Kind/Documentation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🛠️ Maintenance",
|
||||
"labels": [
|
||||
"maintenance",
|
||||
"Maintenance",
|
||||
"Kind/Maintenance",
|
||||
"chore",
|
||||
"Chore",
|
||||
"Kind/Chore"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## ⏪ Reverts",
|
||||
"labels": [
|
||||
"revert",
|
||||
"Revert",
|
||||
"Kind/Revert",
|
||||
"Kind/Reverts",
|
||||
"reverts",
|
||||
"Reverts"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🗑️ Deprecation",
|
||||
"labels": [
|
||||
"deprecation",
|
||||
"Deprecation",
|
||||
"Kind/Deprecation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## ⚡️ Performance Improvements",
|
||||
"labels": [
|
||||
"perf",
|
||||
"Perf",
|
||||
"Kind/Performance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🎨 Styling",
|
||||
"labels": [
|
||||
"style",
|
||||
"Style",
|
||||
"Kind/Style"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "## 🎯 Other Changes",
|
||||
"labels": []
|
||||
}
|
||||
],
|
||||
"label_extractor": [
|
||||
{
|
||||
"pattern": "(\\w+) (.+)",
|
||||
"target": "$1",
|
||||
"on_property": "title"
|
||||
}
|
||||
],
|
||||
"sort": "ASC",
|
||||
"template": "${{CHANGELOG}}",
|
||||
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}",
|
||||
"empty_template": "- no changes",
|
||||
"max_pull_requests": 1000,
|
||||
"max_back_track_time_days": 1000
|
||||
}
|
||||
120
workflows/docker-release.yml
Normal file
120
workflows/docker-release.yml
Normal file
@@ -0,0 +1,120 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
github_release:
|
||||
description: 'Create Gitea Release'
|
||||
default: true
|
||||
type: boolean
|
||||
docker_release:
|
||||
description: 'Push Docker images'
|
||||
default: true
|
||||
type: boolean
|
||||
bump:
|
||||
description: 'Bump type'
|
||||
required: false
|
||||
default: 'patch'
|
||||
type: choice
|
||||
options:
|
||||
- 'major'
|
||||
- 'minor'
|
||||
- 'patch'
|
||||
- 'current'
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch full history
|
||||
fetch-tags: true # Fetch all tags (refs/tags)
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
- name: Install the project dependencies
|
||||
run: |
|
||||
uv sync --all-groups
|
||||
uv add pip
|
||||
uv export --format requirements.txt -o requirements.txt
|
||||
# uv run python -m pip install --upgrade pip
|
||||
# uv run python -m pip install -r requirements.txt
|
||||
|
||||
- name: Set Git identity
|
||||
run: |
|
||||
git config user.name "Gitea CI"
|
||||
git config user.email "ci@git.theprivateserver.de"
|
||||
- name: Bump version
|
||||
id: bump
|
||||
run: |
|
||||
uv tool install bump-my-version
|
||||
uv tool run bump-my-version bump ${{ github.event.inputs.bump }}
|
||||
# echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version
|
||||
echo "VERSION<<EOF" >> $GITHUB_ENV
|
||||
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.TOKEN }}
|
||||
|
||||
- name: Get previous tag
|
||||
id: prev_tag
|
||||
run: |
|
||||
prev=$(git tag --sort=-v:refname | sed -n '2p' || true)
|
||||
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
||||
- name: Build and store Docker image
|
||||
if: ${{ github.event.inputs.docker_release == 'true' }}
|
||||
|
||||
run: |
|
||||
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag ${{ secrets.REGISTRY }}/${REPO_NAME}:latest \
|
||||
--tag ${{ secrets.REGISTRY }}/${REPO_NAME}:${{ env.VERSION }} \
|
||||
--push .
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
- name: Build Changelog
|
||||
id: build_changelog
|
||||
uses: https://github.com/mikepenz/release-changelog-builder-action@v5
|
||||
with:
|
||||
platform: "gitea"
|
||||
baseURL: "http://192.168.178.20:3000"
|
||||
configuration: ".gitea/changelog_config.json"
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Create Gitea Release
|
||||
if: ${{ github.event.inputs.github_release == 'true' }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ env.VERSION }}
|
||||
release_name: Release v${{ env.VERSION }}
|
||||
body: ${{steps.build_changelog.outputs.changelog}}
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
|
||||
|
||||
89
workflows/python_package-release.yml
Normal file
89
workflows/python_package-release.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
bump:
|
||||
description: 'Bump type'
|
||||
required: true
|
||||
default: 'patch'
|
||||
type: choice
|
||||
options:
|
||||
- 'major'
|
||||
- 'minor'
|
||||
- 'patch'
|
||||
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
- name: Set Git identity
|
||||
run: |
|
||||
git config user.name "Gitea CI"
|
||||
git config user.email "ci@git.theprivateserver.de"
|
||||
- name: Bump version
|
||||
id: bump
|
||||
run: |
|
||||
uv tool install bump-my-version
|
||||
uv tool run bump-my-version bump ${{ github.event.inputs.bump }}
|
||||
# echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version
|
||||
echo "VERSION<<EOF" >> $GITHUB_ENV
|
||||
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
- name: Get previous tag
|
||||
id: prev_tag
|
||||
run: |
|
||||
prev=$(git tag --sort=-v:refname | sed -n '2p' || true)
|
||||
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
||||
- name: Build Changelog
|
||||
id: build_changelog
|
||||
uses: https://github.com/mikepenz/release-changelog-builder-action@v6.0.1
|
||||
with:
|
||||
platform: "gitea"
|
||||
baseURL: "http://192.168.178.110:3000"
|
||||
configuration: ".gitea/changelog_config.json"
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Build Distribution
|
||||
run: uv build
|
||||
- name: Publish package
|
||||
env:
|
||||
USERNAME: ${{ github.repository_owner }}
|
||||
run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }}
|
||||
|
||||
|
||||
- name: Create Gitea Release
|
||||
uses: softprops/action-gh-release@master
|
||||
with:
|
||||
tag_name: v${{ env.VERSION }}
|
||||
release_name: Release v${{ env.VERSION }}
|
||||
body: ${{steps.build_changelog.outputs.changelog}}
|
||||
draft: false
|
||||
prerelease: false
|
||||
make_latest: true
|
||||
files: |
|
||||
dist/*.whl
|
||||
dist/*.tar.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
|
||||
27
workflows/test-python-docker-build.yml
Normal file
27
workflows/test-python-docker-build.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Test Python"]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
build_image:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: false
|
||||
platforms: linux/amd64
|
||||
tags: test-build:${{ github.sha }}
|
||||
70
workflows/test-python.yml
Normal file
70
workflows/test-python.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
run_pytest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
|
||||
- name: Install the project dependencies
|
||||
run: |
|
||||
uv sync --all-groups
|
||||
|
||||
- name: Run pytest
|
||||
run: uv run pytest -q
|
||||
|
||||
run_mypy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
|
||||
- name: Install the project dependencies
|
||||
run: |
|
||||
uv sync --all-groups
|
||||
- name: Run mypy
|
||||
run: |
|
||||
uv add pip
|
||||
uv run mypy --install-types --non-interactive
|
||||
|
||||
|
||||
run_lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
|
||||
- name: Install the project dependencies
|
||||
run: |
|
||||
uv sync --all-groups
|
||||
- name: Run lint
|
||||
run: |
|
||||
uv tool install ruff
|
||||
uv tool run ruff check .
|
||||
Reference in New Issue
Block a user