Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sestavení a vydání NetMonitoru pro Windows, Linux a macOS (Intel i Apple Silicon).
# Spuštění:
# a) push na main se zvýšenou verzí v src/netmonitor/__init__.py => release v<verze> se založí sám
# (poznámky z CHANGELOG.md); pokud release té verze už existuje, nic se nevydává
# (poznámky z CHANGELOG.md); pokud release té verze už existuje, doplní se chybějící platformy z commitu tagu
# b) vytvořením release / tagu "v*" na GitHubu
# c) ručně: Actions → Build & Release → Run workflow → zadat existující tag (např. v1.0.1)
# Každý build nahraje své soubory PŘÍMO do release – nepoužívá Actions artefakty
Expand Down Expand Up @@ -94,6 +94,8 @@ jobs:
steps:
- uses: actions/checkout@v5
if: env.DO_BUILD == 'true'
with:
ref: refs/tags/${{ needs.prepare.outputs.tag }}
- uses: actions/setup-python@v6
if: env.DO_BUILD == 'true'
with:
Expand Down
22 changes: 22 additions & 0 deletions tests/test_release_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Regrese L30: doplnění release musí stavět z commitu tagu vydané verze."""
from pathlib import Path
import re


ROOT = Path(__file__).resolve().parent.parent


def test_build_checks_out_release_tag():
workflow = (ROOT / ".github" / "workflows" / "release.yml").read_text(encoding="utf-8")
build = re.search(r"^ build:\n.*?(?=^ [\w-]+:|\Z)", workflow, re.M | re.S)
assert build is not None, "Chybí job build"

checkout = re.search(
r"^ - uses: actions/checkout@v5\n(?P<options>(?: .*\n)*)",
build.group(),
re.M,
)
assert checkout is not None, "V jobu build chybí checkout"
assert " with:\n ref: refs/tags/${{ needs.prepare.outputs.tag }}\n" in checkout.group("options"), (
"Checkout v jobu build musí použít tag z jobu prepare"
)
Loading