wails/v3/internal
Lea Anthony 6d40bcd0d2 ## Summary
I have successfully implemented Mac PKG bundling for Wails v3, addressing GitHub issue #2413. Here's what was accomplished:

###  **Complete Implementation**

**1. PKG Builder (`pkg_builder.go`)**
- Uses macOS `pkgbuild` and `productbuild` tools
- Supports code signing with Developer ID certificates
- Generates distribution XML with customizable installer appearance
- Handles component and product package creation

**2. Notarization Service (`notarization.go`)**
- Full Apple notarization workflow using `notarytool`
- Automatic status polling with timeout handling
- Ticket stapling with `stapler`
- Detailed error logging and debugging support

**3. Configuration System (`config.go`)**
- YAML-based configuration with environment variable support
- Path resolution for relative paths
- Comprehensive validation
- Template generation for easy setup

**4. Command Integration (`command.go`)**
- Seamless integration with existing `wails3 tool package` command
- Support for `--format pkg` option
- Template generation with `--generate-template`
- Configuration validation with `--validate-only`

**5. CLI Integration**
- Updated `tool_package.go` to handle PKG format
- Added new flags for PKG-specific options
- Maintained backward compatibility with existing formats

###  **Key Features**

- **Professional Installers**: Creates distribution-ready PKG installers with custom branding
- **Code Signing**: Full support for Developer ID signing certificates
- **Notarization**: Automated Apple notarization with retry logic and status monitoring
- **Configuration-Driven**: YAML configuration with environment variable expansion
- **Validation**: Comprehensive dependency and configuration validation
- **Template Generation**: Automatic generation of sample configuration files
- **Cross-Platform Safe**: Only runs on macOS, provides clear error messages elsewhere

###  **Testing & Documentation**

- **Unit Tests**: Comprehensive test coverage for all components
- **Integration Tests**: CLI integration and end-to-end workflow testing
- **Documentation**: Complete README with examples, troubleshooting, and workflows
- **Error Handling**: Detailed error messages and validation feedback

###  **Usage Examples**

**Generate Template:**
```bash
wails3 tool package --format pkg --generate-template --config my-pkg.yaml
```

**Build PKG:**
```bash
wails3 tool package --format pkg --config my-pkg.yaml
```

**Validate Only:**
```bash
wails3 tool package --format pkg --config my-pkg.yaml --validate-only
```

###  **Based on Community Input**

The implementation incorporates the sample script provided by @sebheitzmann in the GitHub issue, using:
- `pkgbuild` for component package creation
- `productbuild` for final installer assembly
- Distribution XML for installer customization
- Modern `notarytool` for Apple notarization

###  **Production Ready**

The implementation is ready for v3 and includes:
- Dependency validation for required tools
- Comprehensive error handling and user feedback
- Security best practices for credential handling
- Professional installer workflows matching industry standards
- Full integration with existing Wails build system

This addresses the original GitHub issue by providing a complete Mac PKG bundling and notarization solution that integrates seamlessly with the existing Wails v3 packaging system.
2025-08-04 19:23:08 +10:00
..
assetserver Update runtime 2025-07-15 22:55:12 +10:00
buildinfo [v3] Late service registration and error handling overhaul (#4066) 2025-02-19 09:27:41 +01:00
capabilities Add Linux stubs for badge service and fix capabilities compilation 2025-06-11 23:45:34 +10:00
changelog Nightly release action 2025-07-17 06:28:19 +10:00
commands ## Summary 2025-08-04 19:23:08 +10:00
dbus [V3-Linux] Systray OnClick on initial icon click (#3907) 2024-11-24 07:46:14 +11:00
debug Run go mod tidy on project creation. Use better method of relative module location. 2023-08-12 14:32:52 +10:00
doctor [V3] fix: enhance doctor command to verify Windows SDK dependencies (#4392) 2025-07-15 18:43:23 +10:00
fileexplorer [v3] Fix OpenFileManager on windows (#4375) 2025-07-03 05:36:59 +10:00
flags ## Summary 2025-08-04 19:23:08 +10:00
generator Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
github Fix tests 2025-01-20 19:56:03 +11:00
go-common-file-dialog [v3] allow build with garble (#3192) 2025-01-10 16:36:24 +11:00
hash [v3] Late service registration and error handling overhaul (#4066) 2025-02-19 09:27:41 +01:00
operatingsystem Add Linux stubs for badge service and fix capabilities compilation 2025-06-11 23:45:34 +10:00
packager [V3-Linux] Support for deb,rpm,arch linux packager packaging (#3909) 2024-11-30 13:31:56 +11:00
runtime feature: V3 alpha feature/snapassist support (#4463) 2025-08-02 16:59:49 +10:00
s Support template generation 2025-01-01 20:58:49 +11:00
service Breaking Change: Service method names 2025-01-16 07:47:23 +11:00
signal # Conflicts: 2024-09-18 05:55:49 +10:00
templates Add goModTidy function to clean up Go module dependencies during inst… (#4286) 2025-08-02 15:51:30 +10:00
term [v3] Pass build flags to binding generator (#4023) 2025-01-23 10:58:35 +00:00
version v3.0.0-alpha.18 2025-08-03 02:53:39 +00:00