Files
adguard-control-hub/.gitea/workflows/release.yml
Workflow config file is invalid. Please check your config file: yaml: line 42: could not find expected ':'
Rafal Zielinski e23d60d895
Some checks failed
Tests / test (3.13) (push) Failing after 26s
Tests / lint (push) Failing after 16s
Tests / hacs (push) Failing after 30s
fix: some minor fixes
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
2025-10-02 16:09:10 +01:00

65 lines
1.7 KiB
YAML

name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'requirements_test.txt'
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements_test.txt') }}
restore-keys: |
${{ runner.os }}-pip-release-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_test.txt
- name: Run tests
run: |
python -m pytest tests/ -v --asyncio-mode=auto
- name: Update version in manifest
run: |
python -c "
import json
import os
with open('custom_components/adguard_control_hub/manifest.json', 'r') as f:
manifest = json.load(f)
manifest['version'] = os.environ['GITHUB_REF_NAME'].lstrip('v')
with open('custom_components/adguard_control_hub/manifest.json', 'w') as f:
json.dump(manifest, f, indent=2)
"
- name: Create ZIP archive
run: |
cd custom_components/adguard_control_hub/
zip -r ../../adguard-control-hub.zip .
cd ../..
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./adguard-control-hub.zip
asset_name: adguard-control-hub.zip
asset_content_type: application/zip