name: "Publish Go SDK"
on:
  push:
    branches: ["main"]
    tags: ["sdk/go/v**"]
jobs:
  publish:
    if: github.repository == 'dagger/dagger'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v3
        with:
          go-version: "1.21"
      - run: ./hack/make sdk:go:publish ${{ github.ref_name }}
        env:
          GITHUB_PAT: ${{ secrets.RELEASE_DAGGER_CI_TOKEN }}
          DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
