mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
fix(workflows): remove duplicate validation runs in release workflow
Release workflow now trusts that validate.yml and lint.yml have already run on the main branch commit before tag creation. This prevents duplicate workflow executions. Workflow execution flow: 1. Push to main → validate.yml + lint.yml run (quality gate) 2. prepare-release or auto-tag creates version tag 3. release.yml runs (generates release notes, no validation) This ensures: - Every main commit is validated/linted before tag creation - No duplicate workflow runs (validate/lint run once per commit) - Release workflow is faster (no redundant checks) - Simple, predictable workflow chain Impact: Release process is more efficient and workflows don't run twice.
This commit is contained in:
parent
6614d225e3
commit
605e05ea95
1 changed files with 3 additions and 47 deletions
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
|
|
@ -15,55 +15,11 @@ permissions:
|
|||
contents: write # Needed to create/update releases and push commits
|
||||
|
||||
jobs:
|
||||
# Run validation first - release only proceeds if this passes
|
||||
validate:
|
||||
name: Validate before release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
|
||||
|
||||
- name: Run hassfest validation
|
||||
uses: home-assistant/actions/hassfest@master
|
||||
|
||||
- name: Run HACS validation
|
||||
uses: hacs/action@main
|
||||
with:
|
||||
category: integration
|
||||
|
||||
# Run linting - release only proceeds if this passes
|
||||
lint:
|
||||
name: Lint before release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
version: "0.9.3"
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --frozen
|
||||
|
||||
- name: Run Ruff check
|
||||
run: uv run ruff check .
|
||||
|
||||
- name: Run Ruff format check
|
||||
run: uv run ruff format --check .
|
||||
# Note: We trust that validate.yml and lint.yml have already run on the
|
||||
# main branch commit before the tag was created (either by prepare-release
|
||||
# script or auto-tag workflow). This avoids duplicate workflow runs.
|
||||
|
||||
sync-manifest:
|
||||
needs: [validate, lint] # Only runs if validation and linting pass
|
||||
name: Sync manifest.json with tag version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue