Skip to content
Latchkey

Release workflow (alacritty/alacritty)

The Release workflow from alacritty/alacritty, explained and optimized by Latchkey.

C

CI health: C - fair

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

Grade your own workflow free or run it on Latchkey →
Source: alacritty/alacritty.github/workflows/release.ymlLicense Apache-2.0View source

What it does

This is the Release workflow from the alacritty/alacritty repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Release

on:
  push:
    tags: ["v[0-9]+.[0-9]+.[0-9]+*"]

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  CARGO_TERM_COLOR: always

jobs:
  macos:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: brew install scdoc
      - name: Install ARM target
        run: rustup update && rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin
      - name: Test
        run: cargo test --release --target=x86_64-apple-darwin
      - name: Build ARM
        run: cargo build --release --target=aarch64-apple-darwin
      - name: Make DMG
        run: make dmg-universal
      - name: Upload Application
        run: |
          mv ./target/release/osx/Alacritty.dmg ./Alacritty-${GITHUB_REF##*/}.dmg
          ./.github/workflows/upload_asset.sh ./Alacritty-${GITHUB_REF##*/}.dmg $GITHUB_TOKEN

  windows:
    runs-on: windows-latest

    defaults:
      run:
        shell: bash

    steps:
      - uses: actions/checkout@v4
      - name: Test
        run: cargo test --release
      - name: Build
        run: cargo build --release
      - name: Upload portable executable
        run: |
          cp ./target/release/alacritty.exe ./Alacritty-${GITHUB_REF##*/}-portable.exe
          ./.github/workflows/upload_asset.sh \
            ./Alacritty-${GITHUB_REF##*/}-portable.exe $GITHUB_TOKEN
      - name: Install WiX
        run: dotnet tool install --global wix --version 4.0.5
      - name: Create msi installer
        run: |
          wix extension add WixToolset.UI.wixext/4.0.5 WixToolset.Util.wixext/4.0.5
          wix build -arch "x64" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext \
          -out "./Alacritty-${GITHUB_REF##*/}-installer.msi" "alacritty/windows/wix/alacritty.wxs"
      - name: Upload msi installer
        run: |
          ./.github/workflows/upload_asset.sh \
            ./Alacritty-${GITHUB_REF##*/}-installer.msi $GITHUB_TOKEN

  linux:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: |
          sudo apt update
          sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev \
            libxcb-xfixes0-dev libxkbcommon-dev python3 scdoc
      - name: Test
        run: cargo test --release
      - name: Generate manpages
        run: |
          scdoc < extra/man/alacritty.1.scd | gzip -c > "./alacritty.1.gz"
          scdoc < extra/man/alacritty-msg.1.scd | gzip -c > "./alacritty-msg.1.gz"
          scdoc < extra/man/alacritty.5.scd | gzip -c > "./alacritty.5.gz"
          scdoc < extra/man/alacritty-bindings.5.scd | gzip -c > "./alacritty-bindings.5.gz"
          scdoc < extra/man/alacritty-escapes.7.scd | gzip -c > "./alacritty-escapes.7.gz"
      - name: Upload Assets
        run: |
          mv ./extra/logo/alacritty-term.svg ./Alacritty.svg
          ./.github/workflows/upload_asset.sh ./Alacritty.svg $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty.1.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-msg.1.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty.5.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-bindings.5.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-escapes.7.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.bash $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.fish $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/_alacritty $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/linux/Alacritty.desktop $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/alacritty.info $GITHUB_TOKEN

The same workflow, on Latchkey

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

name: Release
 
on:
  push:
    tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
 
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  CARGO_TERM_COLOR: always
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  macos:
    timeout-minutes: 30
    runs-on: macos-latest
 
    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: brew install scdoc
      - name: Install ARM target
        run: rustup update && rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin
      - name: Test
        run: cargo test --release --target=x86_64-apple-darwin
      - name: Build ARM
        run: cargo build --release --target=aarch64-apple-darwin
      - name: Make DMG
        run: make dmg-universal
      - name: Upload Application
        run: |
          mv ./target/release/osx/Alacritty.dmg ./Alacritty-${GITHUB_REF##*/}.dmg
          ./.github/workflows/upload_asset.sh ./Alacritty-${GITHUB_REF##*/}.dmg $GITHUB_TOKEN
 
  windows:
    timeout-minutes: 30
    runs-on: windows-latest
 
    defaults:
      run:
        shell: bash
 
    steps:
      - uses: actions/checkout@v4
      - name: Test
        run: cargo test --release
      - name: Build
        run: cargo build --release
      - name: Upload portable executable
        run: |
          cp ./target/release/alacritty.exe ./Alacritty-${GITHUB_REF##*/}-portable.exe
          ./.github/workflows/upload_asset.sh \
            ./Alacritty-${GITHUB_REF##*/}-portable.exe $GITHUB_TOKEN
      - name: Install WiX
        run: dotnet tool install --global wix --version 4.0.5
      - name: Create msi installer
        run: |
          wix extension add WixToolset.UI.wixext/4.0.5 WixToolset.Util.wixext/4.0.5
          wix build -arch "x64" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext \
          -out "./Alacritty-${GITHUB_REF##*/}-installer.msi" "alacritty/windows/wix/alacritty.wxs"
      - name: Upload msi installer
        run: |
          ./.github/workflows/upload_asset.sh \
            ./Alacritty-${GITHUB_REF##*/}-installer.msi $GITHUB_TOKEN
 
  linux:
    timeout-minutes: 30
    runs-on: latchkey-small
 
    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        run: |
          sudo apt update
          sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev \
            libxcb-xfixes0-dev libxkbcommon-dev python3 scdoc
      - name: Test
        run: cargo test --release
      - name: Generate manpages
        run: |
          scdoc < extra/man/alacritty.1.scd | gzip -c > "./alacritty.1.gz"
          scdoc < extra/man/alacritty-msg.1.scd | gzip -c > "./alacritty-msg.1.gz"
          scdoc < extra/man/alacritty.5.scd | gzip -c > "./alacritty.5.gz"
          scdoc < extra/man/alacritty-bindings.5.scd | gzip -c > "./alacritty-bindings.5.gz"
          scdoc < extra/man/alacritty-escapes.7.scd | gzip -c > "./alacritty-escapes.7.gz"
      - name: Upload Assets
        run: |
          mv ./extra/logo/alacritty-term.svg ./Alacritty.svg
          ./.github/workflows/upload_asset.sh ./Alacritty.svg $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty.1.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-msg.1.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty.5.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-bindings.5.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./alacritty-escapes.7.gz $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.bash $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/alacritty.fish $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/completions/_alacritty $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/linux/Alacritty.desktop $GITHUB_TOKEN
          ./.github/workflows/upload_asset.sh ./extra/alacritty.info $GITHUB_TOKEN
 

What changed

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 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