Release workflow (petretiandrea/home-assistant-tapo-p100)
The Release workflow from petretiandrea/home-assistant-tapo-p100, explained and optimized by Latchkey.
CI health: F - at risk
Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Release workflow from the petretiandrea/home-assistant-tapo-p100 repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Release
on:
workflow_dispatch:
push:
branches:
- dev
permissions:
contents: write
jobs:
lint:
uses: ./.github/workflows/lint.yml
tests:
uses: ./.github/workflows/tests.yml
validate:
uses: ./.github/workflows/validate.yml
release:
name: Semantic Release
runs-on: ubuntu-latest
needs: [lint, tests, validate]
environment: release
concurrency:
group: release
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GIT_GITHUB_TOKEN || github.token }}
persist-credentials: false
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- name: Semantic Release (Dry Run)
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'dev', channel: 'dev', prerelease: true} ]
extra_plugins: |
@semantic-release/commit-analyzer@11.1.0
@semantic-release/release-notes-generator@12.1.0
@semantic-release/git@10.0.1
@semantic-release/github@9.2.6
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN || github.token }}
- name: Update versioned files
if: steps.semantic.outputs.new_release_published == 'true'
run: python3 script/sync_version.py "${{ steps.semantic.outputs.new_release_version }}"
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'dev', channel: 'dev', prerelease: true} ]
extra_plugins: |
@semantic-release/commit-analyzer@11.1.0
@semantic-release/release-notes-generator@12.1.0
@semantic-release/git@10.0.1
@semantic-release/github@9.2.6
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN || github.token }}
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Release on: workflow_dispatch: push: branches: - dev permissions: contents: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint: timeout-minutes: 30 uses: ./.github/workflows/lint.yml tests: timeout-minutes: 30 uses: ./.github/workflows/tests.yml validate: timeout-minutes: 30 uses: ./.github/workflows/validate.yml release: timeout-minutes: 30 name: Semantic Release runs-on: latchkey-small needs: [lint, tests, validate] environment: release concurrency: group: release cancel-in-progress: false steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GIT_GITHUB_TOKEN || github.token }} persist-credentials: false - name: Setup Node 20.x uses: actions/setup-node@v4 with: cache: 'npm' node-version: 20 - name: Semantic Release (Dry Run) id: semantic uses: cycjimmy/semantic-release-action@v4 with: semantic_version: 23.0.2 branches: | [ 'main', {name: 'dev', channel: 'dev', prerelease: true} ] extra_plugins: | @semantic-release/commit-analyzer@11.1.0 @semantic-release/release-notes-generator@12.1.0 @semantic-release/git@10.0.1 @semantic-release/github@9.2.6 dry_run: true env: GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN || github.token }} - name: Update versioned files if: steps.semantic.outputs.new_release_published == 'true' run: python3 script/sync_version.py "${{ steps.semantic.outputs.new_release_version }}" - name: Semantic Release uses: cycjimmy/semantic-release-action@v4 with: semantic_version: 23.0.2 branches: | [ 'main', {name: 'dev', channel: 'dev', prerelease: true} ] extra_plugins: | @semantic-release/commit-analyzer@11.1.0 @semantic-release/release-notes-generator@12.1.0 @semantic-release/git@10.0.1 @semantic-release/github@9.2.6 env: GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN || github.token }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 4 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.