Create Release Commit workflow (tsukumijima/KonomiTV)
The Create Release Commit workflow from tsukumijima/KonomiTV, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Create Release Commit workflow from the tsukumijima/KonomiTV 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: Create Release Commit
# 手動実行
on:
workflow_dispatch:
inputs:
version:
type: string
description: 'リリースするバージョン (例: 0.6.0, v はつけない)'
required: true
default: ''
# ジョブの定義
jobs:
# リリースコミットの作成
create_release_commit:
runs-on: ubuntu-22.04
steps:
# KonomiTV のソースコードをチェックアウト
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GIT_PUSH_TOKEN }}
# Node.js 20 環境をセットアップ
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.16.0'
cache: 'yarn'
cache-dependency-path: '${{ github.workspace }}/client/yarn.lock'
# リリースコミットを作成
- name: Create Release Commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git switch master
# ソースコードやドキュメント内のバージョンを更新
sed -i -e 's|"version": ".*",|"version": "${{ github.event.inputs.version }}",|' client/package.json
sed -i -e 's|^version = ".*"|version = "${{ github.event.inputs.version }}"|' installer/pyproject.toml
sed -i -e "s|TARGET_VERSION = '.*'|TARGET_VERSION = '${{ github.event.inputs.version }}'|" installer/KonomiTV-Installer.py
sed -i -e 's|^version = ".*"|version = "${{ github.event.inputs.version }}"|' server/pyproject.toml
sed -i -e "s|VERSION = '.*'|VERSION = '${{ github.event.inputs.version }}'|" server/app/constants.py
sed -i -e 's|download/v.*/thirdparty-linux\.tar\.xz|download/v${{ github.event.inputs.version }}/thirdparty-linux\.tar\.xz|' Dockerfile
sed -i -e 's|download/v.*/KonomiTV-Installer\.elf|download/v${{ github.event.inputs.version }}/KonomiTV-Installer\.elf|' Readme.md
# クライアントをビルド
cd client/
yarn install --frozen-lockfile
yarn build
cd ../
# リリースコミットを作成
git add .
git commit -m 'Release: version ${{ github.event.inputs.version }}'
git push -u origin master
# release ブランチを現在の master ブランチの最新コミット (リリースコミット) に更新する
## release ブランチはリリースしたときのみ更新される
- name: Update Release Branch
run: |
git switch release
git merge master
git push -u origin release
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Create Release Commit # 手動実行 on: workflow_dispatch: inputs: version: type: string description: 'リリースするバージョン (例: 0.6.0, v はつけない)' required: true default: '' # ジョブの定義 jobs: # リリースコミットの作成 create_release_commit: timeout-minutes: 30 runs-on: latchkey-small steps: # KonomiTV のソースコードをチェックアウト - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GIT_PUSH_TOKEN }} # Node.js 20 環境をセットアップ - name: Setup Node.js 20 uses: actions/setup-node@v4 with: node-version: '20.16.0' cache: 'yarn' cache-dependency-path: '${{ github.workspace }}/client/yarn.lock' # リリースコミットを作成 - name: Create Release Commit run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git switch master # ソースコードやドキュメント内のバージョンを更新 sed -i -e 's|"version": ".*",|"version": "${{ github.event.inputs.version }}",|' client/package.json sed -i -e 's|^version = ".*"|version = "${{ github.event.inputs.version }}"|' installer/pyproject.toml sed -i -e "s|TARGET_VERSION = '.*'|TARGET_VERSION = '${{ github.event.inputs.version }}'|" installer/KonomiTV-Installer.py sed -i -e 's|^version = ".*"|version = "${{ github.event.inputs.version }}"|' server/pyproject.toml sed -i -e "s|VERSION = '.*'|VERSION = '${{ github.event.inputs.version }}'|" server/app/constants.py sed -i -e 's|download/v.*/thirdparty-linux\.tar\.xz|download/v${{ github.event.inputs.version }}/thirdparty-linux\.tar\.xz|' Dockerfile sed -i -e 's|download/v.*/KonomiTV-Installer\.elf|download/v${{ github.event.inputs.version }}/KonomiTV-Installer\.elf|' Readme.md # クライアントをビルド cd client/ yarn install --frozen-lockfile yarn build cd ../ # リリースコミットを作成 git add . git commit -m 'Release: version ${{ github.event.inputs.version }}' git push -u origin master # release ブランチを現在の master ブランチの最新コミット (リリースコミット) に更新する ## release ブランチはリリースしたときのみ更新される - name: Update Release Branch run: | git switch release git merge master git push -u origin release
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. - Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.