Add goreleaser configuration and update dependencies #4
Workflow file for this run
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: PR Build | |
| on: | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go-version: ["1.22", "1.23.10"] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| GO111MODULE: "on" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ matrix.go-version }}- | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run tests | |
| run: go test -tags nogui -v ./... | |
| - name: Build binary | |
| run: | | |
| VERSION=pr-${{ github.event.number }}-${{ github.sha }} | |
| go build -tags nogui -ldflags "-X main.version=${VERSION}" -o mcpproxy ./cmd/mcpproxy | |
| - name: Test version output | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| ./mcpproxy.exe --version | |
| else | |
| ./mcpproxy --version | |
| fi | |
| goreleaser-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| GO111MODULE: "on" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23.10" | |
| - name: Check GoReleaser config | |
| uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| version: v2.3.2 | |
| args: check |