simplify cicd

Kim committed Mar 3, 2026 at 10:21 UTC b69cab411a947d5e9bc96c587fdcbf2e8873faa8
6 files changed +53 -70
.github/workflows/cd.yml
+6 -5
@@ -4,13 +4,15 @@ on:
4 push:
5 branches: [main]
6 tags: ["v*"]
7 - release:
8 - types: [published]
7
8 env:
9 REGISTRY: ghcr.io
10 IMAGE_NAME: ${{ github.repository }}
13 - PLATFORMS: linux/amd64,linux/arm64,linux/arm64
11 + PLATFORMS: linux/amd64,linux/arm64
12 +
13 +concurrency:
14 + group: cd-${{ github.ref }}
15 + cancel-in-progress: true
16
17 jobs:
18 build-and-push:
@@ -43,8 +45,7 @@ jobs:
45 with:
46 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47 tags: |
46 - type=ref,event=branch
47 - type=ref,event=pr
48 + type=raw,value=latest,enable={{is_default_branch}}
49 type=semver,pattern={{version}}
50 type=semver,pattern={{major}}.{{minor}}
51 type=semver,pattern={{major}}
.github/workflows/ci.yml
+27 -38
@@ -4,49 +4,38 @@ on:
4 pull_request:
5 branches: [main]
6 push:
7 - branches: [main]
8 - tags: ["v*"]
7 + branches: ["**"]
8 workflow_dispatch:
9
10 +concurrency:
11 + group: ci-${{ github.ref }}
12 + cancel-in-progress: true
13 +
14 jobs:
12 - test:
13 - name: Test
15 + verify:
16 + name: Verify
17 runs-on: ubuntu-latest
18 steps:
16 - - uses: actions/checkout@v5
17 - - uses: actions/setup-go@v6
18 - with:
19 - go-version: "stable"
20 - - run: go mod download
21 - - run: go vet ./...
22 - - run: go test -v -race ./...
23 - - run: make build
19 + - name: Checkout code
20 + uses: actions/checkout@v5
21
25 - lint:
26 - name: Lint
27 - runs-on: ubuntu-latest
28 - steps:
29 - - uses: actions/checkout@v5
30 - - uses: actions/setup-go@v6
22 + - name: Set up Go
23 + uses: actions/setup-go@v6
24 with:
32 - go-version: "stable"
33 - - run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
34 - - run: golangci-lint run
25 + go-version-file: go.mod
26 + cache: true
27
36 - release:
37 - name: Release
38 - runs-on: ubuntu-latest
39 - if: startsWith(github.ref, 'refs/tags/v')
40 - needs: [test, lint]
41 - permissions:
42 - contents: write
43 - steps:
44 - - uses: actions/checkout@v5
45 - - uses: actions/setup-go@v6
46 - with:
47 - go-version: "stable"
48 - - run: make release
49 - - uses: softprops/action-gh-release@v2
50 - with:
51 - files: dist/release/*
52 - draft: true
28 + - name: Download dependencies
29 + run: go mod download
30 +
31 + - name: Install CI tools
32 + run: |
33 + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
34 + go install golang.org/x/vuln/cmd/govulncheck@latest
35 +
36 + - name: Run checks
37 + run: |
38 + make vet
39 + make lint
40 + make test
41 + make vuln
.golangci.yml
+1 -1
@@ -2,7 +2,7 @@ version: "2"
2
3 run:
4 tests: true
5 - go: "1.25"
5 + go: "1.26"
6
7 formatters:
8 enable:
.pre-commit-config.yaml
+12 -20
@@ -21,22 +21,6 @@ repos:
21 - repo: https://github.com/golangci/golangci-lint
22 rev: v2.6.2
23 hooks:
24 - # - id: golangci-lint
25 - # name: golangci-lint
26 - # description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected.
27 - # entry: golangci-lint run --new-from-rev HEAD --fix
28 - # types: [go]
29 - # language: golang
30 - # require_serial: true
31 - # pass_filenames: false
32 - # - id: golangci-lint-full
33 - # name: golangci-lint-full
34 - # description: Fast linters runner for Go. Runs on all files in the module. Use this hook if you use pre-commit in CI.
35 - # entry: golangci-lint run --fix > /dev/null || true
36 - # types: [go]
37 - # language: golang
38 - # require_serial: true
39 - # pass_filenames: false
24 - id: golangci-lint-config-verify
25 name: golangci-lint-config-verify
26 description: Verifies the configuration file
@@ -46,10 +30,18 @@ repos:
30
31 - repo: local
32 hooks:
49 - - id: gofmt
50 - name: gofmt
51 - description: Formats Go source code.
52 - entry: gofmt -w .
33 + - id: make-fmt
34 + name: make fmt
35 + description: Formats Go source code with gofmt and goimports.
36 + entry: make fmt
37 + types: [go]
38 + language: system
39 + pass_filenames: false
40 +
41 + - id: go-vet
42 + name: go vet
43 + description: Runs go vet checks.
44 + entry: go vet ./...
45 types: [go]
46 language: system
47 pass_filenames: false
AGENTS.md
+5 -5
@@ -18,7 +18,7 @@ Lint/Format/Test:
18 - `make fmt` (gofmt + goimports)
19 - `make vet` (go vet)
20 - `make lint` (golangci-lint)
21 -- `make test` (go test -v -race ./...)
21 +- `make test` (go test -v -race -coverprofile=coverage.out ./...)
22 - `make vuln` (govulncheck)
23 - `make tidy` (go mod tidy + go mod verify)
24
@@ -113,7 +113,7 @@ See `docs/portal-deploy-guide.md` for full deployment documentation.
113 ## Repo Basics
114
115 - Module: `gosuda.org/portal`
116 -- Go version: 1.25.3 (from `go.mod`)
116 +- Go version: 1.26.0 (from `go.mod`)
117
118 ## Gosuda Go Standards
119
@@ -162,10 +162,11 @@ Performance:
162
163 Module hygiene:
164 - Always commit `go.mod` and `go.sum`; never commit `go.work`.
165 -- Pin toolchain version to match `go.mod` (currently 1.25.3).
165 +- Pin toolchain version to match `go.mod`
166
167 CI/CD:
168 -- CI runs test -> lint -> security -> build (`.github/workflows/ci.yml`).
168 +- CI runs a single `verify` job: vet + lint + test + vuln (`.github/workflows/ci.yml`).
169 +- CD builds/pushes Docker images on `main` and `v*` tags, and deploys on `main` pushes (`.github/workflows/cd.yml`).
170
171 Verbalized sampling:
172 - For non-trivial changes: sample multiple intents, explore edge cases, assess coupling, tidy first, and surface tradeoffs.
@@ -174,4 +175,3 @@ Refactoring discipline:
175 - Do not stack repeated "minimal patches" that leave logic fragmented across files.
176 - For domain/URL parsing and normalization, keep a single source of truth and make all callers use it.
177 - If a flow is being refactored (e.g., SDK client/listener TLS domain handling), complete consolidation in the same change instead of leaving temporary split logic.
177 -
README.md
+2 -1
@@ -15,9 +15,10 @@ This enables developers to publish local services globally without managing serv
15 ## Features
16
17 - 🔄 **Connection Relay**: Connects clients behind NAT or firewalls through the Portal network
18 +- **Subdomain NAT Routing**: lease names to public subdomains (myapp.<base-domain>) and routes traffic to your local service without opening inbound ports
19 - 🔐 **End-to-End Encryption**: TLS passthrough with relay keyless certificates
20 - 🕊️ **Permissionless Hosting**: Anyone can run their own Portal — no approval needed
20 -- ⚙️ **Simple Setup**: Quick start with Tunnel client or Go SDK
21 +- ⚙️ **Simple Setup**: Quick start with Tunnel client
22
23 ## Quick Start
24