name: Valist Publish
on:
  workflow_run:
    workflows: [Release]
    types: [completed]
jobs:
  valist-publish:
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    runs-on: ubuntu-latest
    steps:
      - uses: robinraju/release-downloader@v1.6
        with:
          repository: "berty/berty"
          latest: true
          tarBall: true
          zipBall: true
          fileName: "*"
      - uses: tenhaus/get-release-or-tag@v2
        id: tag
      - uses: valist-io/valist-github-action@v2
        with:
          private-key: ${{ secrets.VALIST_SIGNER }}
          account: berty
          project: berty
          release: ${{ steps.tag.outputs.tag }}

          platform-darwin-amd64: './berty_darwin_amd64.tar.gz'
          platform-darwin-arm64: './berty_darwin_arm64.tar.gz'
          platform-linux-amd64: './berty_linux_amd64.tar.gz'
          platform-windows-amd64: './berty_windows_amd64.zip'
