Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
495fbe5dce | ||
|
|
6ccca63270 | ||
|
|
f9cbcfe7f6 | ||
|
|
cdba65f5f7 | ||
|
|
c817a47e30 | ||
|
|
96ff3d4285 | ||
|
|
457ff1fa02 |
@@ -0,0 +1,69 @@
|
||||
name: Update Version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: true
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
name: Update Version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.actor != 'gitea-actions[bot]' && github.actor != 'Gitea Actions Bot'
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install python-semantic-release
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --local user.email "actions@gitea.local"
|
||||
git config --local user.name "Gitea Actions Bot"
|
||||
|
||||
- name: Run semantic-release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||
run: |
|
||||
echo "🧹 Сбрасываем конфликтующие переменные Gitea Actions..."
|
||||
unset GITHUB_SERVER_URL
|
||||
unset GITHUB_API_URL
|
||||
unset GITHUB_REPOSITORY
|
||||
|
||||
echo "🔐 Записываем оригинальный Root CA от mkcert из секретов..."
|
||||
echo "${{ secrets.LOCAL_ROOT_CA }}" > /tmp/rootCA.crt
|
||||
|
||||
# Проверка на случай, если секрет забыли настроить
|
||||
if [ ! -s /tmp/rootCA.crt ]; then
|
||||
echo "❌ Ошибка: Секрет LOCAL_ROOT_CA пуст. Проверьте настройки репозитория!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Root CA успешно прочитан."
|
||||
|
||||
# Находим, где конкретно Python (библиотека certifi) хранит свои сертификаты
|
||||
CERTIFI_PATH=$(python3 -c "import certifi; print(certifi.where())")
|
||||
echo "Путь к bundle Python: $CERTIFI_PATH"
|
||||
|
||||
# Внедряем корневой сертификат mkcert в конец доверенного списка Python
|
||||
cat /tmp/rootCA.crt >> "$CERTIFI_PATH"
|
||||
echo "✅ Root CA от mkcert добавлен в доверенные для Python!"
|
||||
|
||||
echo "🚀 Запускаем semantic-release..."
|
||||
semantic-release version
|
||||
@@ -0,0 +1,132 @@
|
||||
name: Test and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch: # Позволяет запускать вручную
|
||||
|
||||
jobs:
|
||||
# Шаг 1: Валидация структуры HA интеграции
|
||||
validate:
|
||||
name: Validate Integration
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Hassfest Validation
|
||||
uses: home-assistant/actions/hassfest@master
|
||||
|
||||
- name: HACS Validation
|
||||
uses: hacs/action@main
|
||||
with:
|
||||
category: "integration"
|
||||
|
||||
# Шаг 2: Запуск тестов (если есть)
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: validate
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest pytest-homeassistant-custom-component
|
||||
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
if [ -d "tests" ]; then
|
||||
pytest tests/ --cov=custom_components/motion_light --cov-report=xml
|
||||
else
|
||||
echo "No tests directory found, skipping tests"
|
||||
fi
|
||||
|
||||
# Шаг 3: Проверка стиля кода
|
||||
lint:
|
||||
name: Code Quality
|
||||
runs-on: ubuntu-latest
|
||||
needs: validate
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install linters
|
||||
run: |
|
||||
pip install black ruff mypy
|
||||
|
||||
- name: Check code formatting with black
|
||||
run: |
|
||||
black --check custom_components/motion_light/ || echo "Code formatting issues found"
|
||||
|
||||
- name: Check code with ruff
|
||||
run: |
|
||||
ruff check custom_components/motion_light/ || echo "Ruff issues found"
|
||||
|
||||
# Шаг 4: Создание релиза (только если все проверки пройдены)
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [validate, test, lint]
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get tag info
|
||||
id: tag
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||
|
||||
if [ -z "$PREV_TAG" ]; then
|
||||
COMMITS=$(git log --pretty=format:"- %s" --reverse)
|
||||
else
|
||||
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s" --reverse)
|
||||
fi
|
||||
|
||||
echo "commits<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$COMMITS" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG="${{ steps.tag.outputs.tag }}"
|
||||
COMMITS="${{ steps.tag.outputs.commits }}"
|
||||
|
||||
echo "🚀 Создаём релиз $TAG в GitHub..."
|
||||
|
||||
cat > /tmp/release_notes.md << EOF
|
||||
## Изменения в версии $TAG
|
||||
|
||||
$COMMITS
|
||||
EOF
|
||||
|
||||
gh release create "$TAG" \
|
||||
--title "Release $TAG" \
|
||||
--notes-file /tmp/release_notes.md \
|
||||
--target main
|
||||
|
||||
echo "✅ Релиз создан!"
|
||||
@@ -0,0 +1,18 @@
|
||||
# CHANGELOG
|
||||
|
||||
<!-- version list -->
|
||||
|
||||
## v1.1.1 (2026-07-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Оформление
|
||||
([`6ccca63`](https://192.168.200.208:3000/sirmrak/motion_recorder/commit/6ccca6327021b53a8cd46e62bb0d740f0a609043))
|
||||
|
||||
|
||||
## v1.1.0 (2026-07-05)
|
||||
|
||||
|
||||
## v1.0.0 (2026-07-03)
|
||||
|
||||
- Initial Release
|
||||
@@ -1,4 +1,4 @@
|
||||
# Motion Recorder for Home Assistant
|
||||
# <img src="custom_components/motion_recorder/brand/icon.png" width="64"> </img> Motion Recorder for Home Assistant
|
||||
English | [Русский](README.ru.md)
|
||||
|
||||
## A powerful Home Assistant integration for recording camera streams based on motion detection with advanced filtering and automated management.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Motion Recorder для Home Assistant
|
||||
# <img src="custom_components/motion_recorder/brand/icon.png" width="64"> </img> Motion Recorder для Home Assistant
|
||||
[English](README.md) | Русский
|
||||
|
||||
Мощная интеграция Home Assistant для записи камер по датчику движения с продвинутой фильтрацией и автоматическим управлением.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"domain": "motion_recorder",
|
||||
"name": "Motion Recorder",
|
||||
"version": "1.1.0",
|
||||
"documentation": "https://github.com/sirmrak/motion_recorder",
|
||||
"issue_tracker": "https://github.com/sirmrak/motion_recorder/issues",
|
||||
"dependencies": ["camera", "stream"],
|
||||
"codeowners": ["@sirmrak"],
|
||||
"requirements": [],
|
||||
"config_flow": true,
|
||||
"dependencies": ["camera", "stream"],
|
||||
"documentation": "https://github.com/sirmrak/motion_recorder",
|
||||
"iot_class": "local_push",
|
||||
"config_flow": true
|
||||
"issue_tracker": "https://github.com/sirmrak/motion_recorder/issues",
|
||||
"requirements": [],
|
||||
"version": "1.1.1"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
[tool.semantic_release]
|
||||
tag_format = "v{version}"
|
||||
|
||||
version_variables = [
|
||||
"custom_components/motion_recorder/manifest.json:version",
|
||||
]
|
||||
|
||||
commit_message = "chore(release): v{version}"
|
||||
|
||||
# ВАЖНО: не создаём релиз в Gitea (релиз будет в GitHub)
|
||||
upload_to_vcs_release = false
|
||||
|
||||
[tool.semantic_release.remote]
|
||||
type = "gitea"
|
||||
domain = "192.168.200.208:3000"
|
||||
api_domain = "192.168.200.208:3000"
|
||||
|
||||
[tool.semantic_release.branches.main]
|
||||
match = "(main|master)"
|
||||
prerelease = false
|
||||
|
||||
[tool.semantic_release.commit_parser_options]
|
||||
allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"]
|
||||
minor_tags = ["feat"]
|
||||
patch_tags = ["fix", "perf"]
|
||||
Reference in New Issue
Block a user