forked from openocta/openocta
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
107 lines (98 loc) · 3.16 KB
/
.goreleaser.yaml
File metadata and controls
107 lines (98 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# GoReleaser 配置:单一二进制(前端+配置已嵌入)、RPM/DEB、ZIP(Windows)、Docker
# 构建顺序:1) 前端 2) 复制 embed 资源 3) 后端 4) 打包
# 使用:GITLAB_TOKEN=xxx goreleaser release --clean
# 或本地:goreleaser release --snapshot --clean --skip=publish
#
# macOS Wails .dmg(arm64 + amd64):
# - 仅在 macOS 上可构建;设置 GORELEASER_INCLUDE_DMG=1 时运行 scripts/goreleaser-wails-dmg.sh。
# - release.extra_files 使用 dist-mac/OpenOcta*.dmg(与 deploy/macos/build-app.sh 一致;勿写入 dist/)。
# - 勿使用多个 -f:GoReleaser 只认最后一个配置文件,会丢失 builds 并报「does not contain a main function」。
version: 2
project_name: openocta
# snapshot 版本不包含 git commit 号,便于安装包/压缩包命名简洁
snapshot:
version_template: "{{ .Version }}-SNAPSHOT"
before:
hooks:
# 从 git tag 设置版本到 src/.env 和 ui/package.json
- ./scripts/set-version.sh
- cp src/.env src/embed/
- make ui
- ls src/embed/
- cd src && go mod download
# 可选:macOS + GORELEASER_INCLUDE_DMG=1 时生成 dist-mac/OpenOcta-*-darwin-{arm64,amd64}.dmg
- ./scripts/goreleaser-wails-dmg.sh
builds:
# Linux 服务端二进制(rpm/deb/tar.gz),Windows/macOS 桌面版由 Wails 构建
- id: openocta
dir: src
main: ./cmd/openocta
binary: openocta
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X github.com/openocta/openocta/pkg/version.Version={{.Version}}
archives:
# Linux 压缩包:openocta + 说明文档
- id: default
wrap_in_directory: true
builds:
- openocta
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz
files:
- none*
- src: src/docs/*
dst: docs
- src: deploy/dist-README.md
dst: README.md
# 独立说明文档压缩包,输出到 dist 目录
- id: docs
meta: true
name_template: "{{ .ProjectName }}-docs_{{ .Version }}"
format: tar.gz
wrap_in_directory: true
files:
- src: src/docs/*
dst: docs
nfpms:
- id: openocta
package_name: openocta
vendor: OpenOcta
maintainer: OpenOcta <noreply@openocta.dev>
homepage: https://docs.openclaw.ai
description: OpenOcta Gateway - Personal AI Assistant control plane
formats:
- rpm
- deb
contents:
- src: deploy/openocta.service
dst: /lib/systemd/system/openocta.service
- src: deploy/dist-README.md
dst: /usr/share/doc/openocta/README.md
scripts:
postinstall: deploy/scripts/postinstall.sh
postremove: deploy/scripts/postremove.sh
#dockers:
# - id: openocta
# goos: linux
# goarch: amd64
# ids:
# - openocta
# image_templates:
# - "openocta/openocta:{{ .Tag }}"
# - "openocta/openocta:latest"
# dockerfile: deploy/Dockerfile.goreleaser
release:
gitlab:
owner: "{{ .Env.CI_PROJECT_NAMESPACE }}"
name: "{{ .Env.CI_PROJECT_NAME }}"
# Wails 打的 DMG(make wails-dmg-all);无文件时 GoReleaser 仅跳过匹配,不报错
extra_files:
- glob: ./dist-mac/OpenOcta*.dmg