# release workflow (AsahiLinux/asahi-installer)

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

Source: https://latchkey.dev/workflows/asahilinux-asahi-installer-release  
Upstream: [AsahiLinux/asahi-installer](https://github.com/AsahiLinux/asahi-installer/blob/main/.github/workflows/release.yaml) (.github/workflows/release.yaml), licence MIT

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

```yaml
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"
```

## FAQ

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

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
