refactor: another refactor
Some checks failed
Integration Testing / Integration Tests (2024.12.0, 3.11) (push) Failing after 27s
Integration Testing / Integration Tests (2024.12.0, 3.12) (push) Failing after 56s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m38s
Integration Testing / Integration Tests (2025.9.4, 3.11) (push) Failing after 19s
Integration Testing / Integration Tests (2025.9.4, 3.12) (push) Failing after 20s
Integration Testing / Integration Tests (2025.9.4, 3.13) (push) Failing after 25s
Code Quality Check / Code Quality Analysis (push) Failing after 20s
Code Quality Check / Security Analysis (push) Failing after 21s
Some checks failed
Integration Testing / Integration Tests (2024.12.0, 3.11) (push) Failing after 27s
Integration Testing / Integration Tests (2024.12.0, 3.12) (push) Failing after 56s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m38s
Integration Testing / Integration Tests (2025.9.4, 3.11) (push) Failing after 19s
Integration Testing / Integration Tests (2025.9.4, 3.12) (push) Failing after 20s
Integration Testing / Integration Tests (2025.9.4, 3.13) (push) Failing after 25s
Code Quality Check / Code Quality Analysis (push) Failing after 20s
Code Quality Check / Security Analysis (push) Failing after 21s
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
@@ -3,32 +3,68 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- 'v*.*.*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Version
|
||||
- name: Validate Tag Format
|
||||
run: |
|
||||
if [[ ! "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "❌ Invalid tag format. Expected: v1.2.3"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Valid semantic version tag: ${{ github.ref_name }}"
|
||||
|
||||
- name: Extract Version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||
VERSION=${{ github.ref_name }}
|
||||
VERSION_NUMBER=${VERSION#v}
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${VERSION_NUMBER}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update Manifest Version
|
||||
run: |
|
||||
sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.version_number }}"/' custom_components/adguard_hub/manifest.json
|
||||
|
||||
- name: Run Tests Before Release
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install homeassistant==2025.9.4
|
||||
pip install -r requirements-dev.txt
|
||||
mkdir -p custom_components
|
||||
touch custom_components/__init__.py
|
||||
python -m pytest tests/ -v --tb=short
|
||||
|
||||
- name: Create Release Archive
|
||||
run: |
|
||||
cd custom_components
|
||||
zip -r ../adguard-control-hub-${{ steps.version.outputs.VERSION }}.zip adguard_hub/
|
||||
zip -r ../adguard-control-hub-${{ steps.version.outputs.version_number }}.zip adguard_hub/
|
||||
|
||||
- name: Generate Release Notes
|
||||
- name: Generate Changelog
|
||||
id: changelog
|
||||
run: |
|
||||
echo "# AdGuard Control Hub v${{ steps.version.outputs.VERSION }}" > release_notes.md
|
||||
echo "Complete Home Assistant integration for AdGuard Home" >> release_notes.md
|
||||
PREVIOUS_TAG=$(git tag --sort=-version:refname | head -2 | tail -1 2>/dev/null || echo "")
|
||||
if [ -z "$PREVIOUS_TAG" ]; then
|
||||
echo "changelog=Initial release of AdGuard Control Hub" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changelog=Changes since $PREVIOUS_TAG" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Release
|
||||
run: echo "Release created for version ${{ steps.version.outputs.VERSION }}"
|
||||
- name: Success Message
|
||||
run: |
|
||||
echo "🎉 Release ${{ steps.version.outputs.version }} created!"
|
||||
echo "📦 Archive: adguard-control-hub-${{ steps.version.outputs.version_number }}.zip"
|
||||
|
Reference in New Issue
Block a user