Skip to content
Latchkey

Build Debian Package workflow (linx-systems/clamui)

The Build Debian Package workflow from linx-systems/clamui, 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: linx-systems/clamui.github/workflows/build-deb.ymlLicense MITView source

What it does

This is the Build Debian Package workflow from the linx-systems/clamui 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: Build Debian Package

on:
  push:
    branches: [master]
    tags: ["v*"]
  pull_request:
    branches: [master]
  workflow_dispatch:
    inputs:
      sign:
        description: "Sign the Debian package with GPG"
        type: boolean
        default: false
  workflow_call:
    inputs:
      sign:
        description: "Sign the Debian package with GPG"
        type: boolean
        default: false

jobs:
  build-deb:
    permissions:
      contents: read
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v7
        with:
          submodules: recursive

      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y dpkg-dev fakeroot dpkg-sig

      - name: Build .deb package
        run: ./debian/build-deb.sh

      # Import GPG key for tag builds or when sign input is true
      - name: Import GPG key
        if: startsWith(github.ref, 'refs/tags/') || inputs.sign == true
        uses: crazy-max/ghaction-import-gpg@v7
        with:
          gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
          passphrase: ${{ secrets.GPG_PASSPHRASE }}
        id: gpg

      # Sign .deb on tag builds or when sign input is true
      - name: Sign Debian package
        if: startsWith(github.ref, 'refs/tags/') || inputs.sign == true
        run: |
          dpkg-sig --sign builder -k ${{ steps.gpg.outputs.fingerprint }} clamui_*.deb

          # Verify signature member exists in the .deb archive
          # (dpkg-sig --verify has a known BADSIG bug on Ubuntu 22.04)
          ar t clamui_*.deb | grep -q _gpgbuilder
          echo "Signature member verified in .deb archive"

      - name: Upload Debian package artifact
        uses: actions/upload-artifact@v7
        with:
          name: debian-package
          path: clamui_*.deb
          retention-days: 7

The same workflow, on Latchkey

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

name: Build Debian Package
 
on:
  push:
    branches: [master]
    tags: ["v*"]
  pull_request:
    branches: [master]
  workflow_dispatch:
    inputs:
      sign:
        description: "Sign the Debian package with GPG"
        type: boolean
        default: false
  workflow_call:
    inputs:
      sign:
        description: "Sign the Debian package with GPG"
        type: boolean
        default: false
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build-deb:
    timeout-minutes: 30
    permissions:
      contents: read
    runs-on: latchkey-small
    steps:
      - name: Checkout repository
        uses: actions/checkout@v7
        with:
          submodules: recursive
 
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y dpkg-dev fakeroot dpkg-sig
 
      - name: Build .deb package
        run: ./debian/build-deb.sh
 
      # Import GPG key for tag builds or when sign input is true
      - name: Import GPG key
        if: startsWith(github.ref, 'refs/tags/') || inputs.sign == true
        uses: crazy-max/ghaction-import-gpg@v7
        with:
          gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
          passphrase: ${{ secrets.GPG_PASSPHRASE }}
        id: gpg
 
      # Sign .deb on tag builds or when sign input is true
      - name: Sign Debian package
        if: startsWith(github.ref, 'refs/tags/') || inputs.sign == true
        run: |
          dpkg-sig --sign builder -k ${{ steps.gpg.outputs.fingerprint }} clamui_*.deb
 
          # Verify signature member exists in the .deb archive
          # (dpkg-sig --verify has a known BADSIG bug on Ubuntu 22.04)
          ar t clamui_*.deb | grep -q _gpgbuilder
          echo "Signature member verified in .deb archive"
 
      - name: Upload Debian package artifact
        uses: actions/upload-artifact@v7
        with:
          name: debian-package
          path: clamui_*.deb
          retention-days: 7
 

What changed

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.

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:

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

Actions used in this workflow