Skip to content
Latchkey

Build/release workflow (meetfranz/franz)

The Build/release workflow from meetfranz/franz, explained and optimized by Latchkey.

C

CI health: C - fair

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

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

What it does

This is the Build/release workflow from the meetfranz/franz 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: Build/release

on: push

env:
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}

jobs:
  release:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        platform: [mac, ubuntu, windows]
        include:
          - platform: mac
            os: macos-latest
            artifactPath: |
              out/*.dmg
              out/*.mac.zip.blockmap
              out/latest-mac.yml
            CSC_LINK: CSC_LINK_MAC

          - platform: ubuntu
            os: ubuntu-latest
            artifactPath: |
              out/*.AppImage
              out/*.deb
              out/latest-linux.yml

          - platform: windows
            os: windows-2019
            artifactPath: |
              out/*.exe
              out/latest.yml
            CSC_LINK: CSC_LINK_WIN

    env:
      CSC_LINK: ${{ secrets[matrix.CSC_LINK] }}
      APPLE_TEAM_ID: ${{ matrix.platform == 'mac' && 'TAC9P63ANZ' || '' }}
      APPLE_ID: ${{ secrets.APPLEID }}
      APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }}

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v1

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v3
        with:
          node-version: 16.14.0
          cache: "npm"

      - name: Set up Python (mac only)
        if: matrix.platform == 'mac'
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'

      - name: Upgrade pip and install setuptools/wheel (mac only)
        if: matrix.platform == 'mac'
        run: |
          python3 -m pip install --upgrade pip setuptools wheel

      - name: Install dependencies
        run: |
          npm i -g lerna@3.8
          npx lerna bootstrap

      - name: Build App
        run: npm run build

      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.platform }}
          path: ${{ matrix.artifactPath }}

The same workflow, on Latchkey

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

name: Build/release
 
on: push
 
env:
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  release:
    timeout-minutes: 30
    runs-on: ${{ matrix.os }}
 
    strategy:
      matrix:
        platform: [mac, ubuntu, windows]
        include:
          - platform: mac
            os: macos-latest
            artifactPath: |
              out/*.dmg
              out/*.mac.zip.blockmap
              out/latest-mac.yml
            CSC_LINK: CSC_LINK_MAC
 
          - platform: ubuntu
            os: ubuntu-latest
            artifactPath: |
              out/*.AppImage
              out/*.deb
              out/latest-linux.yml
 
          - platform: windows
            os: windows-2019
            artifactPath: |
              out/*.exe
              out/latest.yml
            CSC_LINK: CSC_LINK_WIN
 
    env:
      CSC_LINK: ${{ secrets[matrix.CSC_LINK] }}
      APPLE_TEAM_ID: ${{ matrix.platform == 'mac' && 'TAC9P63ANZ' || '' }}
      APPLE_ID: ${{ secrets.APPLEID }}
      APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }}
 
    steps:
      - name: Check out Git repository
        uses: actions/checkout@v1
 
      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v3
        with:
          node-version: 16.14.0
          cache: "npm"
 
      - name: Set up Python (mac only)
        if: matrix.platform == 'mac'
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'
 
      - name: Upgrade pip and install setuptools/wheel (mac only)
        if: matrix.platform == 'mac'
        run: |
          python3 -m pip install --upgrade pip setuptools wheel
 
      - name: Install dependencies
        run: |
          npm i -g lerna@3.8
          npx lerna bootstrap
 
      - name: Build App
        run: npm run build
 
      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.platform }}
          path: ${{ matrix.artifactPath }}
 

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 1 job (3 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow