Skip to content
Latchkey LogoLatchkey home

release workflow (AsahiLinux/asahi-installer)

The release workflow from AsahiLinux/asahi-installer, explained and optimized by Latchkey.

Source: AsahiLinux/asahi-installer.github/workflows/release.yamlLicense MITView source
A
CI health grade
85/100
Health score
2
Jobs per trigger
2
Fixes in the optimized version

In short

  1. CI health: A (excellent)
  2. The optimized version below points runs-on at Latchkey managed runners and adds job timeouts.

What it does

This is the release workflow from the AsahiLinux/asahi-installer 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: release

on:
  workflow_call:
    inputs:
        upload-type:
            required: true
            type: string
  workflow_dispatch:


jobs:
  build:
    uses: ./.github/workflows/build.yaml

  upload-artefact:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Download artefact
        uses: actions/download-artifact@v4
        with:
          name: installer-build
          path: releases/.

      - name: Push to Bunny
        env:
          PKG_URL: "https://storage.bunnycdn.com/asahilinux/${{ inputs.upload-type }}"
          PKG_VER: "installer-${{ needs.build.outputs.installer_ver }}"
          ACCESS_KEY: ${{ secrets.BUNNY_TOKEN }}
        run: |
          if [ ! -e "releases/${PKG_VER}" ]; then
              echo "Package not found!"
              exit 1
          fi

          upload() {
               curl -# --fail --request PUT \
                   --url "${2}" \
                   --variable %ACCESS_KEY \
                   --expand-header 'AccessKey: {{ACCESS_KEY}}' \
                   -H "Content-Type: ${3}" \
                   -H "Accept: application/json" \
                   --data-binary @${1}
          }

          upload "releases/${PKG_VER}" "${PKG_URL}/${PKG_VER}" "application/octet-stream"
          upload "releases/latest" "${PKG_URL}/latest" "text/plain"

The same workflow, on Latchkey

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

workflow (.yml), optimized
name: release

on:
  workflow_call:
    inputs:
        upload-type:
            required: true
            type: string
  workflow_dispatch:


jobs:
  build:
    timeout-minutes: 30
    uses: ./.github/workflows/build.yaml

  upload-artefact:
    timeout-minutes: 30
    needs: build
    runs-on: ubuntu-latest
    runs-on: latchkey-small
    steps:
      - name: Download artefact
        uses: actions/download-artifact@v4
        with:
          name: installer-build
          path: releases/.

      - name: Push to Bunny
        env:
          PKG_URL: "https://storage.bunnycdn.com/asahilinux/${{ inputs.upload-type }}"
          PKG_VER: "installer-${{ needs.build.outputs.installer_ver }}"
          ACCESS_KEY: ${{ secrets.BUNNY_TOKEN }}
        run: |
          if [ ! -e "releases/${PKG_VER}" ]; then
              echo "Package not found!"
              exit 1
          fi

          upload() {
               curl -# --fail --request PUT \
                   --url "${2}" \
                   --variable %ACCESS_KEY \
                   --expand-header 'AccessKey: {{ACCESS_KEY}}' \
                   -H "Content-Type: ${3}" \
                   -H "Accept: application/json" \
                   --data-binary @${1}
          }

          upload "releases/${PKG_VER}" "${PKG_URL}/${PKG_VER}" "application/octet-stream"
          upload "releases/latest" "${PKG_URL}/latest" "text/plain"

What changed

  1. Run on Latchkey managed runners with one line (runs-on), which apply the fixes below automatically and self-heal transient failures. Each Linux x64 job moves to the Latchkey size matching its vCPU count, latchkey-small for a standard 2 vCPU runner; macOS, Windows and arm64 jobs stay as written.
  2. Add a job timeout so a hung step cannot burn hours of runner time.

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:

  • Network fetches

This workflow runs 2 jobs per trigger. 1 of the 2 runs on a standard GitHub-hosted Linux x64 runner, which in a private repository bills $0.006 a minute against $0.0025 on latchkey-small, 58% lower; in a public repository like this one it is free. Estimate the monthly difference with your own run counts.

Actions used in this workflow

  • actions/download-artifact

Frequently asked questions

What does the release workflow (AsahiLinux/asahi-installer) workflow do?
This is the release workflow from the AsahiLinux/asahi-installer repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
What CI health grade does this workflow get?
This Automation and other workflow grades A. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.
How can I improve this Automation and other workflow?
Add job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

References