name: Client Presigner

on:
  push:
    branches: [ "main" ]
    paths:
      - ".github/workflows/client_presigner.yml"
      - "src/main/go/net/eagle0/client_download/**"
      - "src/main/go/net/eagle0/util/**"
  pull_request:
    paths:
      - ".github/workflows/client_presigner.yml"
      - "src/main/go/net/eagle0/client_download/**"
      - "src/main/go/net/eagle0/util/**"

permissions:
  contents: read

jobs:
  client-presigner:
    runs-on: self-hosted

    steps:
      - uses: actions/checkout@v4
        with:
          lfs: false
          clean: false
      - name: Build Client Presigner
        run: bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //src/main/go/net/eagle0/client_download
      - name: Archive presigner binary
        if: success() || failure()
        uses: actions/upload-artifact@v4
        with:
          name: client_download
          path: bazel-bin/src/main/go/net/eagle0/client_download/client_download_/client_download