fix: avoid quadratic response rebuild on wildcard match #180
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - '*' | |
| pull_request: | |
| permissions: | |
| contents: write | |
| env: | |
| GOTOOLCHAIN: local | |
| GOFLAGS: "-tags=nobadger,nomysql,nopgx" | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache-dependency-path: | | |
| go.sum | |
| caddy/go.sum | |
| cache: false | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set GoReleaser Git tags | |
| run: | | |
| tags=$(git tag --list --sort=-version:refname 'v*') | |
| echo "GORELEASER_CURRENT_TAG=$(awk 'NR==1 {print;exit}' <<< "$tags")" >> "$GITHUB_ENV" | |
| echo "GORELEASER_PREVIOUS_TAG=$(awk 'NR==2 {print;exit}' <<< "$tags")" >> "$GITHUB_ENV" | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: latest | |
| args: release --clean ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot --skip=sign' || '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |