Skip to content

Commit 7ed13d1

Browse files
committed
Address comments
Signed-off-by: Daishan Peng <daishan@acorn.io>
1 parent 7195103 commit 7ed13d1

File tree

5 files changed

+43
-62
lines changed

5 files changed

+43
-62
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Push Docker Image
22

33
on:
44
push:
5-
branches: [master, main]
5+
branches: [main]
66

77
env:
88
REGISTRY: ghcr.io

.github/workflows/release.yml

Lines changed: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
name: Release Go Binaries
1+
name: Release
22

33
on:
44
push:
55
tags:
6-
- 'v*'
7-
workflow_dispatch:
8-
inputs:
9-
tag:
10-
description: 'Tag to release (e.g., v1.0.0)'
11-
required: true
12-
type: string
6+
- "v*"
137

148
env:
15-
GO_VERSION: "1.23"
9+
GO_VERSION: "1.25"
1610

1711
jobs:
1812
test:
@@ -44,11 +38,14 @@ jobs:
4438
- name: Install dependencies
4539
run: go mod download
4640

41+
- name: Set Go toolchain
42+
run: go env -w GOTOOLCHAIN=go1.25.0+auto
43+
4744
- name: Run linter
48-
uses: golangci/golangci-lint-action@v4
45+
uses: golangci/golangci-lint-action@v8
4946
with:
50-
version: latest
51-
args: --timeout=5m
47+
version: v2.4.0
48+
args: --timeout=5m --tests=false
5249

5350
- name: Run tests
5451
env:
@@ -93,11 +90,7 @@ jobs:
9390
- name: Get version
9491
id: version
9592
run: |
96-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
97-
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
98-
else
99-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
100-
fi
93+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
10194
10295
- name: Build binary
10396
env:
@@ -116,13 +109,13 @@ jobs:
116109
# For macOS, we'll use a different approach with osxcross or build on macOS runners
117110
echo "Building for macOS..."
118111
fi
119-
112+
120113
mkdir -p dist
121114
binary_name="mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-${{ matrix.name }}"
122115
if [ "${{ matrix.goos }}" = "windows" ]; then
123116
binary_name="${binary_name}.exe"
124117
fi
125-
118+
126119
go build -o "dist/${binary_name}" \
127120
-ldflags="-X main.version=${{ steps.version.outputs.VERSION }} -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \
128121
.
@@ -160,11 +153,7 @@ jobs:
160153
- name: Get version
161154
id: version
162155
run: |
163-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
164-
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
165-
else
166-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
167-
fi
156+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
168157
169158
- name: Build binary
170159
env:
@@ -174,7 +163,7 @@ jobs:
174163
run: |
175164
mkdir -p dist
176165
binary_name="mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-${{ matrix.name }}"
177-
166+
178167
go build -o "dist/${binary_name}" \
179168
-ldflags="-X main.version=${{ steps.version.outputs.VERSION }} -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \
180169
.
@@ -193,11 +182,7 @@ jobs:
193182
- name: Get version
194183
id: version
195184
run: |
196-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
197-
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
198-
else
199-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
200-
fi
185+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
201186
202187
- name: Download macOS binaries
203188
uses: actions/download-artifact@v4
@@ -208,14 +193,14 @@ jobs:
208193
- name: Create universal binary
209194
run: |
210195
mkdir -p dist
211-
196+
212197
# Find the actual binary files
213198
amd64_binary=$(find ./binaries -name "*darwin-amd64*" -type f | head -1)
214199
arm64_binary=$(find ./binaries -name "*darwin-arm64*" -type f | head -1)
215-
200+
216201
echo "AMD64 binary: $amd64_binary"
217202
echo "ARM64 binary: $arm64_binary"
218-
203+
219204
# Create universal binary
220205
lipo -create \
221206
"$amd64_binary" \
@@ -235,19 +220,15 @@ jobs:
235220
permissions:
236221
contents: read
237222
packages: write
238-
223+
239224
steps:
240225
- name: Checkout repository
241226
uses: actions/checkout@v4
242227

243228
- name: Get version
244229
id: version
245230
run: |
246-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
247-
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
248-
else
249-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
250-
fi
231+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
251232
252233
- name: Set up Docker Buildx
253234
uses: docker/setup-buildx-action@v3
@@ -288,19 +269,15 @@ jobs:
288269
runs-on: ubuntu-latest
289270
permissions:
290271
contents: write
291-
272+
292273
steps:
293274
- name: Checkout repository
294275
uses: actions/checkout@v4
295276

296277
- name: Get version
297278
id: version
298279
run: |
299-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
300-
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
301-
else
302-
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
303-
fi
280+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
304281
305282
- name: Download all artifacts
306283
uses: actions/download-artifact@v4
@@ -312,11 +289,11 @@ jobs:
312289
run: |
313290
mkdir -p release
314291
find ./artifacts -type f -name "mcp-oauth-proxy-*" -exec cp {} release/ \;
315-
292+
316293
# Create checksums
317294
cd release
318295
sha256sum * > checksums.txt
319-
296+
320297
# List files for verification
321298
echo "Release files:"
322299
ls -la
@@ -326,40 +303,40 @@ jobs:
326303
run: |
327304
cat << 'EOF' > CHANGELOG.md
328305
## What's Changed in ${{ steps.version.outputs.VERSION }}
329-
306+
330307
### 🚀 Features
331308
- Cross-platform release with native binaries for Linux and macOS
332309
- Multi-architecture Docker images for Linux (AMD64 and ARM64)
333-
310+
334311
### 📦 Binary Downloads
335312
- **Linux AMD64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-linux-amd64`
336313
- **Linux ARM64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-linux-arm64`
337314
- **macOS Universal**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-universal` (Intel + Apple Silicon)
338315
- **macOS AMD64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-amd64` (Intel)
339316
- **macOS ARM64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-arm64` (Apple Silicon)
340-
317+
341318
### 🐳 Docker Images
342319
- **Tagged Release**: `ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:${{ steps.version.outputs.VERSION }}`
343320
- **Latest**: `ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:latest`
344321
- **Platforms**: linux/amd64, linux/arm64
345-
322+
346323
### 🔍 Verification
347324
All binaries can be verified using the included `checksums.txt` file.
348-
325+
349326
### 🛠️ Installation
350-
327+
351328
**Binary Installation:**
352329
1. Download the appropriate binary for your platform
353330
2. Make it executable: `chmod +x mcp-oauth-proxy-*`
354331
3. Move to your PATH: `mv mcp-oauth-proxy-* /usr/local/bin/mcp-oauth-proxy`
355-
332+
356333
**Docker Installation:**
357334
```bash
358335
docker pull ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:${{ steps.version.outputs.VERSION }}
359336
# or
360337
docker pull ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:latest
361338
```
362-
339+
363340
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.VERSION }}
364341
EOF
365342
@@ -373,4 +350,5 @@ jobs:
373350
draft: false
374351
prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }}
375352
token: ${{ secrets.GITHUB_TOKEN }}
376-
generateReleaseNotes: true
353+
generateReleaseNotes: true
354+
allowUpdates: true

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ jobs:
3636
- name: Install dependencies
3737
run: go mod download
3838

39+
- name: Set Go toolchain
40+
run: go env -w GOTOOLCHAIN=go1.25.0+auto
41+
3942
- name: Run linter
40-
uses: golangci/golangci-lint-action@v4
43+
uses: golangci/golangci-lint-action@v8
4144
with:
42-
version: latest
43-
args: --timeout=5m
45+
version: v2.4.0
46+
args: --timeout=5m --tests=false
4447

4548
- name: Run unit tests (PostgreSQL)
4649
run: go test -v -short ./...

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/obot-platform/mcp-oauth-proxy
22

3-
go 1.23.0
3+
go 1.25.0
44

55
require (
66
github.com/gorilla/handlers v1.5.2

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ func main() {
2828
handler := proxy.GetHandler()
2929

3030
// Start server
31-
log.Printf("Starting OAuth proxy server on localhost:" + config.Port)
31+
log.Print("Starting OAuth proxy server on localhost:" + config.Port)
3232
log.Fatal(http.ListenAndServe(":"+config.Port, handler))
3333
}

0 commit comments

Comments
 (0)