name: Build u-boot & BSP

on:
  workflow_dispatch:
    inputs:
      destref:
        type: choice
        description: Beta builds
        options:
        - nightly
        - master
jobs:

  fake:
    runs-on: small
    name: Source changes
    if: ${{ github.repository_owner == 'Armbian' }}
    steps:
      - run: |
          echo "not empty" > changes
      - uses: actions/upload-artifact@v2
        with:
          path: changes
          name: changes
          if-no-files-found: ignore

  legacy:
    needs: [ fake ]
    uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master

    with:

      runner: "ubuntu-latest"
      include: 'grep legacy | '
      exclude: ''
      uploading: false
      destref: ${{ github.event.inputs.destref }}

    secrets:
      GPG_KEY1: ${{ secrets.GPG_KEY1 }}
      GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }}
      GPG_KEY2: ${{ secrets.GPG_KEY2 }}
      GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }}
      SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
      SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }}
      KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }}

  current:
    needs: [ fake ]
    uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master

    with:

      runner: "small"
      include: 'grep current | '
      exclude: ''
      uploading: false
      destref: ${{ github.event.inputs.destref }}

    secrets:
      GPG_KEY1: ${{ secrets.GPG_KEY1 }}
      GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }}
      GPG_KEY2: ${{ secrets.GPG_KEY2 }}
      GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }}
      SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
      SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }}
      KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }}


  edge:
    needs: [ fake ]
    uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master

    with:

      runner: "small"
      include: 'grep edge | '
      exclude: ''
      uploading: false
      destref: ${{ github.event.inputs.destref }}

    secrets:
      GPG_KEY1: ${{ secrets.GPG_KEY1 }}
      GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }}
      GPG_KEY2: ${{ secrets.GPG_KEY2 }}
      GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }}
      SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
      SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }}
      KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
