Skip to content

Instantly share code, notes, and snippets.

@shagr4th
Created October 26, 2023 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shagr4th/2139cfa271c222386039d705e2260dd7 to your computer and use it in GitHub Desktop.
Save shagr4th/2139cfa271c222386039d705e2260dd7 to your computer and use it in GitHub Desktop.
task for wails3 universal macos app
package-universal-darwin:
summary: Packages a production build of the application into an universal `.app` bundle
platform: darwin
cmds:
- task: pre-build
- task: build-frontend
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -tags production -a -ldflags="-w -s" -o bin/{{.APP_NAME}}_amd64
- GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -tags production -a -ldflags="-w -s" -o bin/{{.APP_NAME}}_arm64
- task: post-build
- task: generate-icons
- lipo -create -output bin/{{.APP_NAME}} bin/{{.APP_NAME}}_amd64 bin/{{.APP_NAME}}_arm64
- rm -f bin/{{.APP_NAME}}_amd64 bin/{{.APP_NAME}}_arm64
- task: create-app-bundle
env:
CGO_CFLAGS: "-mmacosx-version-min=10.13"
CGO_LDFLAGS: "-mmacosx-version-min=10.13"
MACOSX_DEPLOYMENT_TARGET: "10.13"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment