| 1 | name: Notify pkg.go.dev |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | push: |
| 6 | tags: [v*] |
| 7 | |
| 8 | permissions: |
| 9 | contents: read |
| 10 | |
| 11 | jobs: |
| 12 | notify: |
| 13 | timeout-minutes: 5 |
| 14 | runs-on: ubuntu-latest |
| 15 | steps: |
| 16 | - uses: actions/checkout@v7 |
| 17 | |
| 18 | - name: Trigger pkg.go.dev update |
| 19 | run: | |
| 20 | MOD=$(grep '^module ' go.mod | awk '{print $2}') |
| 21 | VERSION="${GITHUB_REF#refs/tags/}" |
| 22 | URL="https://pkg.go.dev/fetch/${MOD}@${VERSION}" |
| 23 | curl -sS --max-time 40 --retry 3 --retry-delay 60 --retry-connrefused -X POST "$URL" |