Files

111 lines
3.1 KiB
YAML
Raw Permalink Normal View History

2023-01-18 21:42:49 +11:00
version: '3'
2023-08-18 09:35:03 +10:00
vars:
2023-10-09 17:37:40 +11:00
APP_NAME: "buildtest{{exeExt}}"
2023-01-18 21:42:49 +11:00
tasks:
2023-06-06 20:37:15 +10:00
build:
summary: Builds the application
cmds:
2023-10-09 17:37:40 +11:00
- go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
2023-01-18 21:42:49 +11:00
2023-10-09 17:37:40 +11:00
package:
summary: Packages a production build of the application into a `.app` or `.exe` bundle
deps:
- task: build
2023-08-18 09:35:03 +10:00
cmds:
2023-10-09 17:37:40 +11:00
- task: package:darwin
- task: package:windows
2023-08-18 09:35:03 +10:00
2023-10-09 17:37:40 +11:00
# ------------------------------------------------------------------------------
generate:icons:
summary: Generates Windows `.ico` and Mac `.icns` files from an image
dir: build
2023-08-18 09:35:03 +10:00
cmds:
2023-10-09 17:37:40 +11:00
# Generates both .ico and .icns files
- wails3 generate icons -input appicon.png
2023-08-18 09:35:03 +10:00
2023-10-09 17:37:40 +11:00
build:production:darwin:
summary: Creates a production build of the application
2023-08-18 09:35:03 +10:00
cmds:
2023-10-09 17:37:40 +11:00
- GOOS=darwin GOARCH={{.GOARCH}} go build -tags production -ldflags="-w -s" -o build/bin/{{.APP_NAME}}
env:
CGO_CFLAGS: "-mmacosx-version-min=10.13"
CGO_LDFLAGS: "-mmacosx-version-min=10.13"
MACOSX_DEPLOYMENT_TARGET: "10.13"
GOARCH: '{{.GOARCH}}'
2023-08-18 09:35:03 +10:00
2023-11-01 10:25:28 -05:00
build:production:linux:
summary: Creates a production build of the application
cmds:
- GOOS=linux GOARCH={{.GOARCH}} go build -tags production -ldflags="-w -s" -o build/bin/{{.APP_NAME}}
env:
GOARCH: '{{.GOARCH}}'
2023-10-09 17:37:40 +11:00
generate:app_bundle:
2023-08-18 09:35:03 +10:00
summary: Builds a `.app` bundle
cmds:
- mkdir -p {{.APP_NAME}}.app/Contents/{MacOS,Resources}
- cp build/icons.icns {{.APP_NAME}}.app/Contents/Resources
- cp build/bin/{{.APP_NAME}} {{.APP_NAME}}.app/Contents/MacOS
- cp build/Info.plist {{.APP_NAME}}.app/Contents
2023-10-09 17:37:40 +11:00
package:darwin:arm64:
2023-01-18 21:42:49 +11:00
summary: Packages a production build of the application into a `.app` bundle
2023-10-09 17:37:40 +11:00
platforms:
- darwin
2023-01-18 21:42:49 +11:00
deps:
2023-10-09 17:37:40 +11:00
- task: build:production:darwin
2023-08-18 09:35:03 +10:00
vars:
ARCH: arm64
2023-10-09 17:37:40 +11:00
- generate:icons
2023-01-18 21:42:49 +11:00
cmds:
2023-10-09 17:37:40 +11:00
- task: generate:app_bundle
package:darwin:
summary: Packages a production build of the application into a `.app` bundle
platforms:
- darwin
deps:
- task: build:production:darwin
- generate:icons
cmds:
- task: generate:app_bundle
2023-06-05 19:57:40 +10:00
2023-08-18 09:35:03 +10:00
generate:syso:
2023-06-05 19:57:40 +10:00
dir: build
2023-10-09 17:37:40 +11:00
platforms:
- windows
2023-06-05 19:57:40 +10:00
cmds:
2023-10-09 17:37:40 +11:00
- wails3 generate syso -arch {{.GOARCH}} -icon icon.ico -manifest wails.exe.manifest -info info.json -out ../wails.syso
2023-08-18 09:35:03 +10:00
vars:
2023-10-09 17:37:40 +11:00
GOARCH: '{{.GOARCH}}'
2023-06-05 19:57:40 +10:00
package:windows:
summary: Packages a production build of the application into a `.exe` bundle
2023-10-09 17:37:40 +11:00
platforms:
- windows/amd64
2023-06-05 19:57:40 +10:00
deps:
2023-10-09 17:37:40 +11:00
- generate:icons
2023-06-05 19:57:40 +10:00
cmds:
2023-08-18 09:35:03 +10:00
- task: generate:syso
vars:
2023-10-09 17:37:40 +11:00
GOARCH: amd64
- go build -tags production -ldflags="-w -s -H windowsgui" -o bin/{{.APP_NAME}}
2023-06-05 19:57:40 +10:00
- powershell Remove-item wails.syso
2023-10-09 17:37:40 +11:00
package:windows:arm64:
summary: Packages a production build of the application into a `.exe` bundle (ARM64)
platforms:
- windows
cmds:
- task: generate:syso
vars:
GOARCH: arm64
- go build -tags production -ldflags="-w -s -H windowsgui" -o bin/buildtest.arm64.exe
- powershell Remove-item wails.syso
env:
GOARCH: arm64