- 新增标签管理: 列表/创建/删除/推送标签 (后端API + 前端UI) - 前端新增标签Tab页,支持创建、删除、推送操作 - config.go 改为从可执行文件同目录加载 config.yaml - 各平台构建脚本自动复制 config.yaml 到输出目录 - Windows 打包改为 ZIP 格式 (不依赖 NSIS) - 新增 GitHub Actions Release 工作流 (三平台自动构建+发布)
73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
version: '3'
|
|
|
|
includes:
|
|
common: ../Taskfile.yml
|
|
|
|
tasks:
|
|
build:
|
|
summary: Builds the application for Windows
|
|
deps:
|
|
- task: common:go:mod:tidy
|
|
- task: common:build:frontend
|
|
vars:
|
|
BUILD_FLAGS:
|
|
ref: .BUILD_FLAGS
|
|
PRODUCTION:
|
|
ref: .PRODUCTION
|
|
- task: common:generate:icons
|
|
cmds:
|
|
- task: generate:syso
|
|
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}.exe
|
|
- cmd: powershell Copy-Item config.yaml -Destination {{.BIN_DIR}}/config.yaml -Force
|
|
platforms: [windows]
|
|
- cmd: cp config.yaml {{.BIN_DIR}}/config.yaml
|
|
platforms: [linux, darwin]
|
|
- cmd: powershell Remove-item *.syso
|
|
platforms: [windows]
|
|
- cmd: rm -f *.syso
|
|
platforms: [linux, darwin]
|
|
vars:
|
|
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
|
env:
|
|
GOOS: windows
|
|
CGO_ENABLED: 1
|
|
GOARCH: '{{.ARCH | default ARCH}}'
|
|
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
|
|
|
package:
|
|
summary: Packages a production build of the application into a zip file
|
|
deps:
|
|
- task: build
|
|
vars:
|
|
PRODUCTION: "true"
|
|
cmds:
|
|
- cmd: powershell Compress-Archive -Path "{{.BIN_DIR}}/{{.APP_NAME}}.exe","{{.BIN_DIR}}/config.yaml" -DestinationPath "{{.BIN_DIR}}/{{.APP_NAME}}-windows-{{.ARCH}}.zip" -Force
|
|
vars:
|
|
ARCH: '{{.ARCH | default ARCH}}'
|
|
|
|
generate:syso:
|
|
summary: Generates Windows `.syso` file
|
|
dir: build
|
|
cmds:
|
|
- wails3 generate syso -arch {{.ARCH}} -icon windows/icon.ico -manifest windows/wails.exe.manifest -info windows/info.json -out ../wails_windows_{{.ARCH}}.syso
|
|
vars:
|
|
ARCH: '{{.ARCH | default ARCH}}'
|
|
|
|
create:nsis:installer:
|
|
summary: Creates an NSIS installer
|
|
dir: build/windows/nsis
|
|
deps:
|
|
- task: build
|
|
vars:
|
|
PRODUCTION: "true"
|
|
cmds:
|
|
- wails3 generate webview2bootstrapper -dir "{{.ROOT_DIR}}/build/windows/nsis"
|
|
- makensis -DARG_WAILS_{{.ARG_FLAG}}_BINARY="{{.ROOT_DIR | replace "/" "\\"}}\\{{.BIN_DIR}}\\{{.APP_NAME}}.exe" project.nsi
|
|
vars:
|
|
ARCH: '{{.ARCH | default ARCH}}'
|
|
ARG_FLAG: '{{if eq .ARCH "amd64"}}AMD64{{else}}ARM64{{end}}'
|
|
|
|
run:
|
|
cmds:
|
|
- '{{.BIN_DIR}}/{{.APP_NAME}}.exe'
|