Skip to content

Commit a732e4a

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

File tree

5 files changed

+47
-70
lines changed

5 files changed

+47
-70
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: 35 additions & 64 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:
@@ -57,7 +54,7 @@ jobs:
5754
go test -v -short ./...
5855
go test -v -race ./...
5956
60-
build:
57+
build-linux:
6158
needs: test
6259
runs-on: ubuntu-latest
6360
strategy:
@@ -70,13 +67,6 @@ jobs:
7067
- goos: linux
7168
goarch: arm64
7269
name: linux-arm64
73-
# macOS builds (universal binary will be created separately)
74-
- goos: darwin
75-
goarch: amd64
76-
name: darwin-amd64
77-
- goos: darwin
78-
goarch: arm64
79-
name: darwin-arm64
8070

8171
steps:
8272
- name: Checkout repository
@@ -93,11 +83,7 @@ jobs:
9383
- name: Get version
9484
id: version
9585
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
86+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
10187
10288
- name: Build binary
10389
env:
@@ -116,13 +102,13 @@ jobs:
116102
# For macOS, we'll use a different approach with osxcross or build on macOS runners
117103
echo "Building for macOS..."
118104
fi
119-
105+
120106
mkdir -p dist
121107
binary_name="mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-${{ matrix.name }}"
122108
if [ "${{ matrix.goos }}" = "windows" ]; then
123109
binary_name="${binary_name}.exe"
124110
fi
125-
111+
126112
go build -o "dist/${binary_name}" \
127113
-ldflags="-X main.version=${{ steps.version.outputs.VERSION }} -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \
128114
.
@@ -160,11 +146,7 @@ jobs:
160146
- name: Get version
161147
id: version
162148
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
149+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
168150
169151
- name: Build binary
170152
env:
@@ -174,7 +156,7 @@ jobs:
174156
run: |
175157
mkdir -p dist
176158
binary_name="mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-${{ matrix.name }}"
177-
159+
178160
go build -o "dist/${binary_name}" \
179161
-ldflags="-X main.version=${{ steps.version.outputs.VERSION }} -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -s -w" \
180162
.
@@ -193,11 +175,7 @@ jobs:
193175
- name: Get version
194176
id: version
195177
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
178+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
201179
202180
- name: Download macOS binaries
203181
uses: actions/download-artifact@v4
@@ -208,14 +186,14 @@ jobs:
208186
- name: Create universal binary
209187
run: |
210188
mkdir -p dist
211-
189+
212190
# Find the actual binary files
213191
amd64_binary=$(find ./binaries -name "*darwin-amd64*" -type f | head -1)
214192
arm64_binary=$(find ./binaries -name "*darwin-arm64*" -type f | head -1)
215-
193+
216194
echo "AMD64 binary: $amd64_binary"
217195
echo "ARM64 binary: $arm64_binary"
218-
196+
219197
# Create universal binary
220198
lipo -create \
221199
"$amd64_binary" \
@@ -235,19 +213,15 @@ jobs:
235213
permissions:
236214
contents: read
237215
packages: write
238-
216+
239217
steps:
240218
- name: Checkout repository
241219
uses: actions/checkout@v4
242220

243221
- name: Get version
244222
id: version
245223
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
224+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
251225
252226
- name: Set up Docker Buildx
253227
uses: docker/setup-buildx-action@v3
@@ -288,19 +262,15 @@ jobs:
288262
runs-on: ubuntu-latest
289263
permissions:
290264
contents: write
291-
265+
292266
steps:
293267
- name: Checkout repository
294268
uses: actions/checkout@v4
295269

296270
- name: Get version
297271
id: version
298272
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
273+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
304274
305275
- name: Download all artifacts
306276
uses: actions/download-artifact@v4
@@ -312,11 +282,11 @@ jobs:
312282
run: |
313283
mkdir -p release
314284
find ./artifacts -type f -name "mcp-oauth-proxy-*" -exec cp {} release/ \;
315-
285+
316286
# Create checksums
317287
cd release
318288
sha256sum * > checksums.txt
319-
289+
320290
# List files for verification
321291
echo "Release files:"
322292
ls -la
@@ -326,40 +296,40 @@ jobs:
326296
run: |
327297
cat << 'EOF' > CHANGELOG.md
328298
## What's Changed in ${{ steps.version.outputs.VERSION }}
329-
299+
330300
### 🚀 Features
331301
- Cross-platform release with native binaries for Linux and macOS
332302
- Multi-architecture Docker images for Linux (AMD64 and ARM64)
333-
303+
334304
### 📦 Binary Downloads
335305
- **Linux AMD64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-linux-amd64`
336306
- **Linux ARM64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-linux-arm64`
337307
- **macOS Universal**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-universal` (Intel + Apple Silicon)
338308
- **macOS AMD64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-amd64` (Intel)
339309
- **macOS ARM64**: `mcp-oauth-proxy-${{ steps.version.outputs.VERSION }}-darwin-arm64` (Apple Silicon)
340-
310+
341311
### 🐳 Docker Images
342312
- **Tagged Release**: `ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:${{ steps.version.outputs.VERSION }}`
343313
- **Latest**: `ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:latest`
344314
- **Platforms**: linux/amd64, linux/arm64
345-
315+
346316
### 🔍 Verification
347317
All binaries can be verified using the included `checksums.txt` file.
348-
318+
349319
### 🛠️ Installation
350-
320+
351321
**Binary Installation:**
352322
1. Download the appropriate binary for your platform
353323
2. Make it executable: `chmod +x mcp-oauth-proxy-*`
354324
3. Move to your PATH: `mv mcp-oauth-proxy-* /usr/local/bin/mcp-oauth-proxy`
355-
325+
356326
**Docker Installation:**
357327
```bash
358328
docker pull ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:${{ steps.version.outputs.VERSION }}
359329
# or
360330
docker pull ghcr.io/${{ github.repository_owner }}/mcp-oauth-proxy:latest
361331
```
362-
332+
363333
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.VERSION }}
364334
EOF
365335
@@ -373,4 +343,5 @@ jobs:
373343
draft: false
374344
prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }}
375345
token: ${{ secrets.GITHUB_TOKEN }}
376-
generateReleaseNotes: true
346+
generateReleaseNotes: true
347+
allowUpdates: true

.github/workflows/test.yml

Lines changed: 9 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 ./...
@@ -93,6 +96,9 @@ jobs:
9396
- name: Install dependencies
9497
run: go mod download
9598

99+
- name: Set Go toolchain
100+
run: go env -w GOTOOLCHAIN=go1.25.0+auto
101+
96102
- name: Run unit tests (SQLite)
97103
run: go test -v -short ./...
98104

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)