release workflow (AsahiLinux/asahi-installer)
The release workflow from AsahiLinux/asahi-installer, explained and optimized by Latchkey.
CI health: A - excellent
The optimized version below 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: 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. This example useslatchkey-small; pick the runner size that fits the job. - 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. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.