on:
  pull_request:
    paths-ignore:
      - 'README.md'
      - 'CONTRIBUTING.md'
      - 'COPYING'
      - 'website/**'
      - '.github/*.md'
      - '.github/FUNDING.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

name: Build Code
jobs:
  build:
    runs-on: macos-latest
    defaults:
      run:
        shell: pwsh
    steps:
    - name: Checkout code 👋
      uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
    - name: Install Go 🗳
      uses: ./.github/workflows/composite/bootstrap-go
    - name: Run GoReleaser 🚀
      uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94
      with:
        distribution: goreleaser
        version: v2.3.2
        args: build --clean --snapshot --skip=post-hooks --skip=before
        workdir: src
    - name: Archive production artifacts
      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
      with:
        name: builds
        retention-days: 1
        path: |
          src/dist
