release workflow (AsahiLinux/asahi-installer)
The release workflow from AsahiLinux/asahi-installer, explained and optimized by Latchkey.
- A
- CI health grade
- 85/100
- Health score
- 2
- Jobs per trigger
- 2
- Fixes in the optimized version
In short
- CI health: A (excellent)
- 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
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.
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
- 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-smallfor a standard 2 vCPU runner; macOS, Windows and arm64 jobs stay as written. - 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