name: release-artifacts-auto

on:
  push:
    branches:
      - master
      - v[0-9]+.[0-9]+
    tags:
      - v[0-9]+.[0-9]+.[0-9]+

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  release-artifacts:
    if: github.repository == 'anza-xyz/agave'
    uses: ./.github/workflows/release-artifacts.yml
    with:
      commit: ${{ github.sha }}
    secrets:
      GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL: ${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}

  error_reporting:
    needs:
      - release-artifacts
    if: failure() && github.event_name == 'push'
    uses: ./.github/workflows/error-reporting.yml
    secrets:
      WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
