name: 'idkyet aur builder'
description: 'aur builder for the idkyet linux project'
inputs:
  layer_config_file:
    description: 'layer config file'
    required: true
#outputs:
#  hashes:
#    description: 'json dict of hashes of all files'
runs:
  using: "composite"
  steps:
    - name: Get aur cache key
      id: cache-aur-key
      uses: docker://git.fml128.ch/fml128/idkyet-builder:2025.01.301118
      with:
        args: generate_aur_cache_key ${{ inputs.layer_config_file }}
    - name: Restore aur cache
      if: steps.cache-aur-key.outputs.cache-aur-key != 'empty'
      id: cache-aur-restore
      uses: actions/cache/restore@v4
      with:
        path: aur
        key: aur-${{ github.repository }}-${{ steps.cache-aur-key.outputs.cache-aur-key }}
        restore-keys: |
          aur-${{ github.repository }}-${{ steps.cache-aur-key.outputs.cache-aur-key-restore }}
          aur-${{ github.repository }}-
    - name: Build aur
      if: steps.cache-aur-key.outputs.cache-aur-key != 'empty' && steps.cache-aur-restore.outputs.cache-hit != 'true'
      uses: docker://git.fml128.ch/fml128/idkyet-builder:2025.01.301118
      with:
        args: build_aur_packages ${{ inputs.layer_config_file }}
    - name: Save aur cache
      if: steps.cache-aur-key.outputs.cache-aur-key != 'empty' && steps.cache-aur-restore.outputs.cache-hit != 'true'
      uses: actions/cache/save@v4
      with:
        path: aur
        key: aur-${{ github.repository }}-${{ steps.cache-aur-key.outputs.cache-aur-key }}