Dev #1
@@ -4,10 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
workflow_dispatch: # Позволяет запускать вручную
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Шаг 1: Валидация структуры HA интеграции
|
|
||||||
validate:
|
validate:
|
||||||
name: Validate Integration
|
name: Validate Integration
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -23,7 +22,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
category: "integration"
|
category: "integration"
|
||||||
|
|
||||||
# Шаг 2: Запуск тестов (если есть)
|
|
||||||
test:
|
test:
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -51,7 +49,6 @@ jobs:
|
|||||||
echo "No tests directory found, skipping tests"
|
echo "No tests directory found, skipping tests"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Шаг 3: Проверка стиля кода
|
|
||||||
lint:
|
lint:
|
||||||
name: Code Quality
|
name: Code Quality
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -77,7 +74,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ruff check custom_components/motion_light/ || echo "Ruff issues found"
|
ruff check custom_components/motion_light/ || echo "Ruff issues found"
|
||||||
|
|
||||||
# Шаг 4: Создание релиза (только если все проверки пройдены)
|
|
||||||
release:
|
release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -97,6 +93,15 @@ jobs:
|
|||||||
TAG=${GITHUB_REF#refs/tags/}
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Проверяем, это beta или stable релиз
|
||||||
|
if [[ "$TAG" == *"beta"* ]]; then
|
||||||
|
echo "is_beta=true" >> $GITHUB_OUTPUT
|
||||||
|
PRERELEASE_FLAG="--prerelease"
|
||||||
|
else
|
||||||
|
echo "is_beta=false" >> $GITHUB_OUTPUT
|
||||||
|
PRERELEASE_FLAG=""
|
||||||
|
fi
|
||||||
|
|
||||||
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$PREV_TAG" ]; then
|
if [ -z "$PREV_TAG" ]; then
|
||||||
@@ -115,18 +120,26 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
TAG="${{ steps.tag.outputs.tag }}"
|
TAG="${{ steps.tag.outputs.tag }}"
|
||||||
COMMITS="${{ steps.tag.outputs.commits }}"
|
COMMITS="${{ steps.tag.outputs.commits }}"
|
||||||
|
IS_BETA="${{ steps.tag.outputs.is_beta }}"
|
||||||
|
|
||||||
echo "🚀 Создаём релиз $TAG в GitHub..."
|
echo "🚀 Создаём релиз $TAG в GitHub..."
|
||||||
|
|
||||||
|
if [ "$IS_BETA" = "true" ]; then
|
||||||
|
TITLE="Beta Release $TAG"
|
||||||
|
else
|
||||||
|
TITLE="Release $TAG"
|
||||||
|
fi
|
||||||
|
|
||||||
cat > /tmp/release_notes.md << EOF
|
cat > /tmp/release_notes.md << EOF
|
||||||
## Изменения в версии $TAG
|
## $TITLE
|
||||||
|
|
||||||
$COMMITS
|
$COMMITS
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
gh release create "$TAG" \
|
gh release create "$TAG" \
|
||||||
--title "Release $TAG" \
|
--title "$TITLE" \
|
||||||
--notes-file /tmp/release_notes.md \
|
--notes-file /tmp/release_notes.md \
|
||||||
--target main
|
--target main \
|
||||||
|
${IS_BETA:+--prerelease}
|
||||||
|
|
||||||
echo "✅ Релиз создан!"
|
echo "✅ Релиз создан!"
|
||||||
Reference in New Issue
Block a user