Skip to content
Latchkey

Publish Release workflow (tsukumijima/KonomiTV)

The Publish Release workflow from tsukumijima/KonomiTV, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: tsukumijima/KonomiTV.github/workflows/publish_release.yamlLicense MITView source

What it does

This is the Publish Release 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

workflow (.yml)

name: Publish Release

# release ブランチに変更があったとき or 手動実行
on:
  push:
    branches:
      - release
  workflow_dispatch:

# ジョブの定義
jobs:

  # インストーラーのビルド
  ## リリースコミットでのみ実行する
  build_installer:
    if: contains(github.event.head_commit.message, 'Release:')
    uses: tsukumijima/KonomiTV/.github/workflows/build_installer.yaml@master

  # サードパーティーライブラリのビルド
  ## リリースコミットでのみ実行する
  build_thirdparty:
    if: contains(github.event.head_commit.message, 'Release:')
    uses: tsukumijima/KonomiTV/.github/workflows/build_thirdparty.yaml@master

  # 両方のビルドが終わったら、タグ付けしてリリースを公開
  ## リリースコミットでのみ実行する
  publish_release:
    runs-on: ubuntu-22.04
    if: contains(github.event.head_commit.message, 'Release:')
    needs:
      - build_installer
      - build_thirdparty
    steps:

      # ビルド済みのインストーラーとサードパーティーライブラリをダウンロード
      - name: Download Installer (for Windows)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer.exe
          path: ${{ github.workspace }}/
      - name: Download Installer (for Linux)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer.elf
          path: ${{ github.workspace }}/
      - name: Download Installer (for Linux ARM)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer-ARM.elf
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Windows)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-windows.7z
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Linux)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-linux.tar.xz
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Linux ARM)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-linux-arm.tar.xz
          path: ${{ github.workspace }}/

      # KonomiTV のソースコードをチェックアウト
      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          path: KonomiTV
          token: ${{ secrets.GIT_PUSH_TOKEN }}

      # KonomiTV のバージョン番号をリリースコミットのコミットメッセージから取得
      - name: Get Version
        id: get_version
        env:
          COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
        run: |
          echo version=$(echo "$COMMIT_MESSAGE" | sed -e 's/Release: version //') >> $GITHUB_OUTPUT

      # リリースコミットに対応する新バージョンのタグを release ブランチで作成
      ## この git push origin --tags をトリガーに Docker イメージを公開するワークフローが実行される
      ## Docker イメージのビルドには新バージョンのサードパーティーライブラリが必要なため、リリースを作成する直前に行う必要がある
      ## Docker イメージを公開するワークフロー側でも、サードパーティーライブラリが確実にアップロードされるまで1分ほど待つようにしている
      - name: Create New Version Tag
        working-directory: KonomiTV
        run: |
          git config user.name 'github-actions[bot]'
          git config user.email 'github-actions[bot]@users.noreply.github.com'
          git switch release
          git tag v${{ steps.get_version.outputs.version }} release
          git push origin --tags

      # リリースを作成
      - name: Create Release
        uses: ncipollo/release-action@v1
        with:
          artifacts: 'KonomiTV-Installer.exe,KonomiTV-Installer.elf,KonomiTV-Installer-ARM.elf,thirdparty-windows.7z,thirdparty-linux.tar.xz,thirdparty-linux-arm.tar.xz'
          generateReleaseNotes: true
          name: KonomiTV (β) ${{ steps.get_version.outputs.version }}
          tag: v${{ steps.get_version.outputs.version }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

 
name: Publish Release
 
# release ブランチに変更があったとき or 手動実行
on:
  push:
    branches:
      - release
  workflow_dispatch:
 
# ジョブの定義
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
 
  # インストーラーのビルド
  ## リリースコミットでのみ実行する
  build_installer:
    timeout-minutes: 30
    if: contains(github.event.head_commit.message, 'Release:')
    uses: tsukumijima/KonomiTV/.github/workflows/build_installer.yaml@master
 
  # サードパーティーライブラリのビルド
  ## リリースコミットでのみ実行する
  build_thirdparty:
    timeout-minutes: 30
    if: contains(github.event.head_commit.message, 'Release:')
    uses: tsukumijima/KonomiTV/.github/workflows/build_thirdparty.yaml@master
 
  # 両方のビルドが終わったら、タグ付けしてリリースを公開
  ## リリースコミットでのみ実行する
  publish_release:
    timeout-minutes: 30
    runs-on: latchkey-small
    if: contains(github.event.head_commit.message, 'Release:')
    needs:
      - build_installer
      - build_thirdparty
    steps:
 
      # ビルド済みのインストーラーとサードパーティーライブラリをダウンロード
      - name: Download Installer (for Windows)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer.exe
          path: ${{ github.workspace }}/
      - name: Download Installer (for Linux)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer.elf
          path: ${{ github.workspace }}/
      - name: Download Installer (for Linux ARM)
        uses: actions/download-artifact@v4
        with:
          name: KonomiTV-Installer-ARM.elf
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Windows)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-windows.7z
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Linux)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-linux.tar.xz
          path: ${{ github.workspace }}/
      - name: Download Thirdparty Library (for Linux ARM)
        uses: actions/download-artifact@v4
        with:
          name: thirdparty-linux-arm.tar.xz
          path: ${{ github.workspace }}/
 
      # KonomiTV のソースコードをチェックアウト
      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          path: KonomiTV
          token: ${{ secrets.GIT_PUSH_TOKEN }}
 
      # KonomiTV のバージョン番号をリリースコミットのコミットメッセージから取得
      - name: Get Version
        id: get_version
        env:
          COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
        run: |
          echo version=$(echo "$COMMIT_MESSAGE" | sed -e 's/Release: version //') >> $GITHUB_OUTPUT
 
      # リリースコミットに対応する新バージョンのタグを release ブランチで作成
      ## この git push origin --tags をトリガーに Docker イメージを公開するワークフローが実行される
      ## Docker イメージのビルドには新バージョンのサードパーティーライブラリが必要なため、リリースを作成する直前に行う必要がある
      ## Docker イメージを公開するワークフロー側でも、サードパーティーライブラリが確実にアップロードされるまで1分ほど待つようにしている
      - name: Create New Version Tag
        working-directory: KonomiTV
        run: |
          git config user.name 'github-actions[bot]'
          git config user.email 'github-actions[bot]@users.noreply.github.com'
          git switch release
          git tag v${{ steps.get_version.outputs.version }} release
          git push origin --tags
 
      # リリースを作成
      - name: Create Release
        uses: ncipollo/release-action@v1
        with:
          artifacts: 'KonomiTV-Installer.exe,KonomiTV-Installer.elf,KonomiTV-Installer-ARM.elf,thirdparty-windows.7z,thirdparty-linux.tar.xz,thirdparty-linux-arm.tar.xz'
          generateReleaseNotes: true
          name: KonomiTV (β) ${{ steps.get_version.outputs.version }}
          tag: v${{ steps.get_version.outputs.version }}
 

What changed

2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

This workflow runs 3 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow