name: Go Proxy

on:
  push:
    tags:
      - "v*.*.*"

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Set up Go
        uses: actions/setup-go@v7
        with:
          go-version: "1.26"

      - name: Proxy
        run: |
          GOPROXY=${{ secrets.GOPROXY }} go mod download all
          GOPROXY=${{ secrets.GOPROXY }} go mod tidy

      - name: Actions Status Discord
        uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
        if: always()
        with:
          webhook: ${{ secrets.GOPROXY_DISCORD_WEBHOOK }}
          status: ${{ job.status }}
          content: "🥃 <@193791870285905920>"
          title: "GOPROXY"
          description: "`ipsw` GOPROXY Github Action"
          url: "https://github.com/blacktop/ipsw/actions/workflows/goproxy.yml"
          username: GitHub Actions
          avatar_url: ${{ secrets.GOPROXY_AVATAR_URL }}
