mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 03:35:56 +02:00
Configure bumpver and release workflow
This commit is contained in:
parent
225a853b27
commit
196d4cc178
6 changed files with 53 additions and 4 deletions
27
.github/workflows/release.yml
vendored
Normal file
27
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
name: Create release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*.*.*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
uses: ./.github/workflows/pytest.yml
|
||||||
|
release:
|
||||||
|
name: Release pushed tag
|
||||||
|
needs: [tests]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Create release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
gh release create "$tag" \
|
||||||
|
--repo="$GITHUB_REPOSITORY" \
|
||||||
|
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
|
||||||
|
--generate-notes
|
|
@ -10,6 +10,7 @@ from datetime import datetime
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from aiohttp import ClientResponse
|
from aiohttp import ClientResponse
|
||||||
|
from .const import USER_AGENT
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -70,9 +71,9 @@ class IrmKmiApiClient:
|
||||||
) -> any:
|
) -> any:
|
||||||
"""Get information from the API."""
|
"""Get information from the API."""
|
||||||
if headers is None:
|
if headers is None:
|
||||||
headers = {'User-Agent': 'github.com/jdejaegh/irm-kmi-ha'}
|
headers = {'User-Agent': USER_AGENT}
|
||||||
else:
|
else:
|
||||||
headers['User-Agent'] = 'github.com/jdejaegh/irm-kmi-ha'
|
headers['User-Agent'] = USER_AGENT
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with async_timeout.timeout(60):
|
async with async_timeout.timeout(60):
|
||||||
|
|
|
@ -159,3 +159,5 @@ IRM_KMI_NAME: Final = {
|
||||||
}
|
}
|
||||||
|
|
||||||
WEEKDAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
WEEKDAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
||||||
|
|
||||||
|
USER_AGENT: Final = 'github.com/jdejaegh/irm-kmi-ha 0.2.28'
|
|
@ -3,7 +3,7 @@ import logging
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from custom_components.irm_kmi.const import POLLEN_LEVEL_TO_COLOR, POLLEN_NAMES
|
from .const import POLLEN_LEVEL_TO_COLOR, POLLEN_NAMES
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
18
pyproject.toml
Normal file
18
pyproject.toml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[tool.bumpver]
|
||||||
|
current_version = "0.2.28"
|
||||||
|
version_pattern = "MAJOR.MINOR.PATCH"
|
||||||
|
commit_message = "bump version {old_version} -> {new_version}"
|
||||||
|
tag_message = "{new_version}"
|
||||||
|
tag_scope = "default"
|
||||||
|
pre_commit_hook = ""
|
||||||
|
post_commit_hook = ""
|
||||||
|
commit = true
|
||||||
|
tag = true
|
||||||
|
push = true
|
||||||
|
|
||||||
|
[tool.bumpver.file_patterns]
|
||||||
|
"pyproject.toml" = [
|
||||||
|
'current_version = "{version}"',
|
||||||
|
]
|
||||||
|
"custom_components/irm_kmi/manifest.json" = ['"version": "{version}"']
|
||||||
|
"custom_components/irm_kmi/const.py" = ["'github.com/jdejaegh/irm-kmi-ha {version}'"]
|
|
@ -2,4 +2,5 @@ homeassistant==2025.2.4
|
||||||
pytest_homeassistant_custom_component==0.13.214
|
pytest_homeassistant_custom_component==0.13.214
|
||||||
pytest
|
pytest
|
||||||
freezegun
|
freezegun
|
||||||
isort
|
isort
|
||||||
|
bumpver
|
Loading…
Add table
Reference in a new issue