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@0c366fd6a839edf440554fa01a7085ccba70ac98
    - name: Install Go 🗳
      uses: ./.github/workflows/composite/bootstrap-go
    - name: Run GoReleaser 🚀
      uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a
      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@b7c566a772e6b6bfb58ed0dc250532a479d7789f
      with:
        name: builds
        retention-days: 1
        path: |
          src/dist
