cli/cmd/core-task-change/tasks/build-windows.yml

39 lines
1.3 KiB
YAML

version: '3'
# This file contains the build logic specifically for the Windows platform.
includes:
common: ./common.yml
tasks:
build:
desc: "Builds the application for Windows."
dir: "{{.APP_ROOT}}"
deps:
- task: common:go:mod:tidy
- task: common:build:public
vars:
PRODUCTION: '{{.PRODUCTION | default "false"}}'
- task: common:generate:icons
cmds:
- go build {{.BUILD_FLAGS}} -o bin/{{.APP_NAME}}.exe
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 "amd64"}}'
PRODUCTION: '{{.PRODUCTION | default "false"}}'
package:
desc: "Packages the application as a .exe installer for Windows."
dir: "{{.APP_ROOT}}"
deps:
- task: build
vars:
PRODUCTION: "true"
cmds:
- echo "Packaging for Windows..."
# This command assumes Wails handles the packaging process, potentially using NSIS or MSIX.
# You may need to adjust based on your specific packaging tool.
- wails3 build -package -platform windows/{{.ARCH | default "amd6d64"}} -production -clean -o "{{.APP_NAME}}.exe"