Skip to content
Latchkey

Build Desktop Artifacts workflow (Maoleio/CPA-Codex-Manager)

The Build Desktop Artifacts workflow from Maoleio/CPA-Codex-Manager, explained and optimized by Latchkey.

F

CI health: F - at risk

Point runs-on at Latchkey and get caching, 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: Maoleio/CPA-Codex-Manager.github/workflows/build.ymlLicense MITView source

What it does

This is the Build Desktop Artifacts workflow from the Maoleio/CPA-Codex-Manager 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 Desktop Artifacts

on:
  push:
    branches:
      - main
      - master
    tags:
      - "v*"
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build-windows:
    name: Build Windows
    runs-on: windows-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install dependencies
        shell: pwsh
        run: |
          python -m pip install --upgrade pip
          python -m pip install .
          python -m pip install pyinstaller pillow

      - name: Build Windows artifact
        shell: cmd
        run: scripts\build_windows.bat onefile

      - name: Upload Windows artifact
        uses: actions/upload-artifact@v4
        with:
          name: CPA-Codex-Manager-windows
          path: |
            dist/CPA-Codex-Manager.exe
            dist/CPA-Codex-Manager/*.exe
          if-no-files-found: error

  build-macos:
    name: Build macOS
    runs-on: macos-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install .
          python -m pip install pyinstaller

      - name: Build macOS DMG
        run: |
          chmod +x scripts/build_macos_dmg.sh
          ./scripts/build_macos_dmg.sh

      - name: Upload macOS artifact
        uses: actions/upload-artifact@v4
        with:
          name: CPA-Codex-Manager-macos
          path: dist/CPA-Codex-Manager.dmg
          if-no-files-found: error

  release:
    name: Publish Release Assets
    if: startsWith(github.ref, 'refs/tags/')
    needs:
      - build-windows
      - build-macos
    runs-on: ubuntu-latest

    steps:
      - name: Download Windows artifact
        uses: actions/download-artifact@v4
        with:
          name: CPA-Codex-Manager-windows
          path: release-assets/windows

      - name: Download macOS artifact
        uses: actions/download-artifact@v4
        with:
          name: CPA-Codex-Manager-macos
          path: release-assets/macos

      - name: Publish GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          files: |
            release-assets/windows/**
            release-assets/macos/**

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Build Desktop Artifacts
 
on:
  push:
    branches:
      - main
      - master
    tags:
      - "v*"
  workflow_dispatch:
 
permissions:
  contents: write
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build-windows:
    timeout-minutes: 30
    name: Build Windows
    runs-on: windows-latest
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          cache: 'pip'
          python-version: "3.11"
 
      - name: Install dependencies
        shell: pwsh
        run: |
          python -m pip install --upgrade pip
          python -m pip install .
          python -m pip install pyinstaller pillow
 
      - name: Build Windows artifact
        shell: cmd
        run: scripts\build_windows.bat onefile
 
      - name: Upload Windows artifact
        uses: actions/upload-artifact@v4
        with:
          name: CPA-Codex-Manager-windows
          path: |
            dist/CPA-Codex-Manager.exe
            dist/CPA-Codex-Manager/*.exe
          if-no-files-found: error
 
  build-macos:
    timeout-minutes: 30
    name: Build macOS
    runs-on: macos-latest
 
    steps:
      - name: Checkout
        uses: actions/checkout@v4
 
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          cache: 'pip'
          python-version: "3.11"
 
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install .
          python -m pip install pyinstaller
 
      - name: Build macOS DMG
        run: |
          chmod +x scripts/build_macos_dmg.sh
          ./scripts/build_macos_dmg.sh
 
      - name: Upload macOS artifact
        uses: actions/upload-artifact@v4
        with:
          name: CPA-Codex-Manager-macos
          path: dist/CPA-Codex-Manager.dmg
          if-no-files-found: error
 
  release:
    timeout-minutes: 30
    name: Publish Release Assets
    if: startsWith(github.ref, 'refs/tags/')
    needs:
      - build-windows
      - build-macos
    runs-on: latchkey-small
 
    steps:
      - name: Download Windows artifact
        uses: actions/download-artifact@v4
        with:
          name: CPA-Codex-Manager-windows
          path: release-assets/windows
 
      - name: Download macOS artifact
        uses: actions/download-artifact@v4
        with:
          name: CPA-Codex-Manager-macos
          path: release-assets/macos
 
      - name: Publish GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          files: |
            release-assets/windows/**
            release-assets/macos/**
 

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