115 lines
4.6 KiB
YAML
115 lines
4.6 KiB
YAML
---
|
|
version: "3"
|
|
|
|
vars:
|
|
ClientBinary: name.pztrn.bunker.client{{exeExt}}
|
|
MetadataParams: --metadata "Branch={{ .BRANCH }}" --metadata "Build={{ .BUILD }}" --metadata "BuildDate={{ .BUILD_DATE }}" --metadata "Commit={{ .COMMIT }}" --metadata "Version={{ .VERSION }}"
|
|
|
|
env:
|
|
CGO_ENABLED: 1
|
|
|
|
tasks:
|
|
build:
|
|
desc: "Build client."
|
|
dir: ./client/cmd/client
|
|
internal: true
|
|
cmds:
|
|
- task: ::ensure-builddir
|
|
- task: cleanup
|
|
- fyne build --release -o ../../../.build/{{ .ClientBinary }} --pprof --pprof-port 6060 {{ .MetadataParams }}
|
|
|
|
build-debug:
|
|
desc: "Build client in debug mode."
|
|
internal: true
|
|
dir: ./client/cmd/client
|
|
cmds:
|
|
- task: ::ensure-builddir
|
|
- task: cleanup
|
|
- fyne build -o ../../../.build/{{ .ClientBinary }} --tags debug {{ .MetadataParams }}
|
|
|
|
# build-production:
|
|
# desc: "Build production package for current OS."
|
|
# dir: ./client/cmd/client
|
|
# cmds:
|
|
# - task: ::ensure-builddir
|
|
# - task: cleanup
|
|
# - fyne package --release --app-id name.pztrn.bunker.client -executable name.pztrn.bunker.client -icon ../../Icon.png --release --name "pztrn's Bunker" --app-version "{{ .CLIENT_VERSION }}" --app-build "{{ .BUILD }}" {{ .MetadataParams }}
|
|
|
|
# build-web:
|
|
# desc: "Build web version."
|
|
# dir: ./client/cmd/client
|
|
# cmds:
|
|
# - fyne package -os web --app-id name.pztrn.bunker.client -icon ../../Icon.png --release --name "pztrn's Bunker" --app-version "{{ .CLIENT_VERSION }}" --app-build "{{ .BUILD }}" {{ .MetadataParams }}
|
|
|
|
build-dist:
|
|
desc: "Builds windows/amd64, linux/amd64, darwin/arm64, android/arm64 distribution archives."
|
|
cmds:
|
|
- task: build-dist-android-arm64
|
|
- task: build-dist-darwin
|
|
- task: build-dist-linux-amd64
|
|
- task: build-dist-windows-amd64
|
|
|
|
build-dist-android-arm64:
|
|
desc: "Build android/arm64 APK file."
|
|
dir: ./client/cmd/client
|
|
cmds:
|
|
- task: ensure-dist-dir
|
|
#- fyne-cross android -app-version="{{ .CLIENT_VERSION }}" -app-build="{{ .BUILD }}" -arch=arm64 -pull client/cmd/client
|
|
- fyne package --release --target=android/arm64 --app-id name.pztrn.bunker.client -icon ../../../Icon.png --name "pztrn's Bunker" --app-version "{{ .CLIENT_VERSION }}" --app-build "{{ .BUILD }}" {{ .MetadataParams }}
|
|
- mv pztrn_s_Bunker.apk "../../../dist/pztrn's Bunker-{{ .CLIENT_VERSION }}-{{ .BUILD }}-android-arm64.apk"
|
|
|
|
build-dist-darwin:
|
|
desc: "Build darwin (macOS) version."
|
|
dir: ./client/cmd/client
|
|
cmds:
|
|
- task: ensure-dist-dir
|
|
#- fyne-cross darwin -app-version="{{ .CLIENT_VERSION }}" -app-build="{{ .BUILD }}" -arch=arm64 -category=6007 -pull {{ .MetadataParams }} client/cmd/client
|
|
- fyne package --release --target=darwin --app-id name.pztrn.bunker.client -executable name.pztrn.bunker.client -icon ../../../Icon.png --name "pztrn's Bunker" --app-version "{{ .CLIENT_VERSION }}" --app-build "{{ .BUILD }}" {{ .MetadataParams }}
|
|
- tar -czf "pztrn's Bunker-{{ .CLIENT_VERSION }}-{{ .BUILD }}-darwin-arm64.tar.gz" *.app
|
|
- mv *.tar.gz ../../../dist/
|
|
|
|
build-dist-ios:
|
|
desc: "Build iOS version."
|
|
dir: ./client/cmd/client
|
|
cmds:
|
|
- task: ensure-dist-dir
|
|
- fyne package --release --target=ios --app-id name.pztrn.bunker.client -icon ../../../Icon.png --name "pztrn's Bunker" --app-version "{{ .CLIENT_VERSION }}" --app-build "{{ .BUILD }}" {{ .MetadataParams }}
|
|
|
|
build-dist-linux-amd64:
|
|
desc: "Build linux/amd64 using fyne-cross"
|
|
cmds:
|
|
- task: ensure-dist-dir
|
|
- fyne-cross linux -app-version="{{ .CLIENT_VERSION }}" -app-build="{{ .BUILD }}" -arch=amd64 -pull {{ .MetadataParams }} client/cmd/client
|
|
- mv "fyne-cross/dist/linux-amd64/pztrn's Bunker.tar.xz" "dist/pztrn's Bunker-{{ .CLIENT_VERSION }}-{{ .BUILD }}-linux-amd64.tar.xz"
|
|
|
|
build-dist-windows-amd64:
|
|
desc: "Build windows/amd64 using fyne-cross"
|
|
cmds:
|
|
- task: ensure-dist-dir
|
|
- fyne-cross windows -app-version="{{ .CLIENT_VERSION }}" -app-build="{{ .BUILD }}" -arch=amd64 -pull {{ .MetadataParams }} client/cmd/client
|
|
- mv "fyne-cross/dist/windows-amd64/pztrn's Bunker.exe.zip" "dist/pztrn's Bunker-{{ .CLIENT_VERSION }}-{{ .BUILD }}-windows-amd64.zip"
|
|
|
|
cleanup:
|
|
desc: "Cleanup build environment."
|
|
cmds:
|
|
- rm .build/{{ .ClientBinary }}
|
|
ignore_error: true
|
|
|
|
ensure-dist-dir:
|
|
desc: "Ensures dist directory in repo root exists."
|
|
internal: true
|
|
cmds:
|
|
- mkdir dist || exit 0
|
|
|
|
run:
|
|
desc: "Launch client."
|
|
cmds:
|
|
- task: build
|
|
- .build/{{ .ClientBinary }}
|
|
|
|
run-debug:
|
|
desc: "Launch client in debug mode."
|
|
cmds:
|
|
- task: build-debug
|
|
- .build/{{ .ClientBinary }}
|