Skip to content

Commit 581cef8

Browse files
committed
update rule
1 parent 398e41f commit 581cef8

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
description: Publish releases from local builds instead of GitHub Actions
3+
alwaysApply: true
4+
---
5+
6+
# Manual Local Release
7+
8+
- Do not rely on GitHub Actions tag workflows to publish releases for this repository.
9+
- Preferred release flow: push code and tag first, build release archives locally, then upload artifacts directly.
10+
- Build release packages from the target tag in a clean checkout or temporary worktree with `make package`.
11+
- Always build the web UI before packaging so release binaries embed `internal/server/static` instead of falling back to a missing local `web/dist`.
12+
- Publish GitHub releases manually with `gh release create` or `gh release upload` after local packaging.
13+
- Publish GitLab release assets manually or via `scripts/push.sh` with `--skip-build` after local packaging is complete.
14+
- Keep release notes concise: use 1-3 bullets that describe the actual user-visible fixes or changes in this version.
15+
- Follow repository network rules during release work:
16+
- GitLab and other internal services: direct connection, no proxy
17+
- GitHub and other external services: `source ~/.myshrc` before upload commands

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ build: build-web
1515

1616
build-all: build-darwin-arm64 build-darwin-amd64 build-linux-amd64 build-linux-arm64 build-windows-amd64
1717

18-
build-darwin-arm64:
18+
# Cross-platform binaries must embed the built web UI too.
19+
build-darwin-arm64: build-web
1920
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-$(VERSION)-darwin-arm64 ./cmd/csghub-lite
2021

21-
build-darwin-amd64:
22+
build-darwin-amd64: build-web
2223
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-$(VERSION)-darwin-amd64 ./cmd/csghub-lite
2324

24-
build-linux-amd64:
25+
build-linux-amd64: build-web
2526
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-$(VERSION)-linux-amd64 ./cmd/csghub-lite
2627

27-
build-linux-arm64:
28+
build-linux-arm64: build-web
2829
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-$(VERSION)-linux-arm64 ./cmd/csghub-lite
2930

30-
build-windows-amd64:
31+
build-windows-amd64: build-web
3132
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-$(VERSION)-windows-amd64.exe ./cmd/csghub-lite
3233

3334
clean-dist:
@@ -68,7 +69,7 @@ test-cover:
6869
lint:
6970
golangci-lint run ./...
7071

71-
release-snapshot:
72+
release-snapshot: build-web
7273
goreleaser release --snapshot --clean
7374

7475
clean:

docs/guides/packaging.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ csghub-lite-linux-arm64 # Linux ARM64
3535
csghub-lite-windows-amd64.exe # Windows
3636
```
3737

38+
`make build``make build-all``make package` 都会先构建 `web` 并同步到 `internal/server/static`,确保发布二进制内嵌 Web UI。
39+
3840
### 版本号
3941

4042
版本号通过 `git tag` 管理,自动嵌入二进制文件:
@@ -123,7 +125,7 @@ export GITLAB_TOKEN="glpat-..." # 或写入 local/secrets.env 后由 push.sh
123125
./scripts/push.sh --skip-github --skip-build --skip-gitlab-git --tag v0.5.10
124126
```
125127

126-
本地从零构建再上传时,检出对应 tag 后执行 `make package`,然后 `scripts/push.sh --skip-github --skip-build --tag vX.Y.Z`(会包含向 GitLab 推送 tag,除非加 `--skip-gitlab-git`)。
128+
本地从零构建再上传时,检出对应 tag 后执行 `make package`,确认产物已内嵌最新 Web UI,然后执行 `scripts/push.sh --skip-github --skip-build --tag vX.Y.Z`(会包含向 GitLab 推送 tag,除非加 `--skip-gitlab-git`)。
127129

128130
### 本地测试发布
129131

0 commit comments

Comments
 (0)