A comprehensive Unity build pipeline that supports multi-platform desktop builds, code signing, packaging. Exports executables to GitHub releases.
- ✅ Multi-platform builds (Windows, macOS, Linux)
- ✅ macOS code signing and notarization
- ✅ GitHub Actions-powered DMG creation
- ✅ Windows installer generation (Inno Setup)
- ✅ Automated GitHub releases
- ✅ Build profiles support
- ✅ Version management
- Executable:
.exefile - Package:
.ziparchive - Installer:
.exeinstaller (when Inno Setup is available)
- Executable:
.appbundle - Package:
.ziparchive (local) +.dmgdisk image (via GitHub Actions) - Features: Professional DMG with drag-and-drop installation interface
- Executable: Binary file
- Package:
.ziparchive
- Unity 2022.3+ with target platform modules installed
- GitHub repository with appropriate secrets configured
- Platform-specific tools (see below)
Add these secrets to your GitHub repository:
UNITY_LICENSE # Your Unity license (Personal/Plus/Pro)
UNITY_EMAIL # Unity account email
UNITY_PASSWORD # Unity account password
For professional macOS distribution with proper code signing:
P12_CERT # Your Developer ID certificate as base64-encoded P12 file
P12_PASSWORD # Password for the P12 certificate (if required)
APPLE_ID_PASSWORD # App-specific password for notarization (optional)
Note: The build pipeline supports flexible secret naming - you can use P12_CERT or P12_CERTIFICATE as the secret name.
DMG creation is now handled by GitHub Actions. The workflow files are automatically set up when you import the build pipeline.
When you open a Unity project with the GitHub Build Pipeline for the first time, the workflow files will be automatically extracted to .github/workflows/ at your project root.
If you need to regenerate the workflow files, you can call the regeneration method directly:
- Open Unity
- In the Console, run:
GitHub_Build_Pipeline.WorkflowAutoSetup.RegenerateWorkflowsZip() - Commit and push the generated
.github/workflows/files to your repository
Note: No local tools are required - DMG creation happens entirely on GitHub's macOS runners.
The build pipeline includes a smart auto-setup system:
- Bundled Workflows: The package includes a
workflows.zipfile containing the latest GitHub Actions workflows - Auto-Extraction: When Unity loads, the
WorkflowAutoSetupscript automatically checks if.github/workflows/exists - Seamless Setup: If the folder is missing, the workflows are extracted automatically
- Always Up-to-Date: When you generate new workflow files, the ZIP is automatically updated
This ensures that anyone importing your build pipeline gets the correct workflow files without manual setup.
- Open the Build Pipeline window:
Build → Build Pipeline - Configure your settings:
- Version: Auto-increment or manual
- Platforms: Select Windows, macOS, and/or Linux
- Pipeline Steps: Enable signing, installers, GitHub upload as needed
- DMG Creation: Enable to trigger GitHub Actions DMG workflow
- Click "Start Build Pipeline"
To create a DMG from an existing GitHub release:
- Configure GitHub repository URL and token
- Click "Create DMG" in the Individual Steps section
- The DMG will be automatically attached to the latest release
The pipeline includes comprehensive GitHub Actions workflows:
- Builds on native runners (Windows, macOS, Linux)
- Creates ZIP packages for all platforms
- Uploads to GitHub Releases automatically
- Downloads macOS ZIP from the latest GitHub release
- Creates professional DMG with drag-and-drop interface
- Attaches DMG directly to the GitHub release
- Push to main/develop: Builds all platforms
- Create Release: Builds and publishes release assets
- Manual Trigger: Go to Actions → Unity Build Pipeline → Run workflow
The macOS DMG creation process:
-
Professional DMG Creation: Uses
create-dmgfor polished DMG files with:- Custom volume name and icon
- Drag-and-drop interface with Applications folder shortcut
- Proper window sizing and positioning
- Professional appearance for distribution
-
Code Signing Integration:
- Supports both GitHub secrets and local certificate signing
- Automatic fallback to ad-hoc signing if certificate issues occur
- Timeout protection prevents hanging on security commands
- Flexible secret naming (
P12_CERTorP12_CERTIFICATE)
-
Distribution Optimization:
- Sets proper file permissions (
chmod 644) for cross-user compatibility - Removes quarantine attributes to reduce security warnings
- Creates readable files for all users
- Professional DMG formatting for end-user distribution
- Sets proper file permissions (
-
Fallback Methods:
- Uses native
hdiutilifcreate-dmgis unavailable - Always creates ZIP file as backup option
- Graceful error handling with informative messages
- Uses native
Enable "Use Build Profiles" to use platform-specific settings:
Assets/Settings/Build Profiles/
├── Windows Profile.asset
├── MacOS Profile.asset
└── Linux Profile.asset
For distribution outside the Mac App Store:
- Certificate: Export Developer ID Application certificate as .p12
- Entitlements: Use custom or default hardened runtime entitlements
- Configuration: Set certificate path and password in build pipeline window
- GitHub Secrets: Configure
P12_CERTsecret with base64-encoded certificate - Password Management: Set
P12_PASSWORDif your certificate requires a password - Automatic Fallback: If signing fails, automatically falls back to ad-hoc signing
- Timeout Protection: All signing operations have timeout protection to prevent hanging
- Requirements: Apple Developer account with notarization access
- Secrets:
APPLE_ID_PASSWORD(app-specific password) - Configuration: Set Apple ID and Team ID in build pipeline
- Automatic: Runs after successful Developer ID signing
Requires Inno Setup:
- Download and install Inno Setup
- Configure publisher information
- Set installation options
GitHub_Build_Pipeline/
├── Editor/
│ ├── BuildPipelineWindow.cs # Main build pipeline UI
│ ├── GitHubAPI.cs # GitHub API integration
│ └── WorkflowAutoSetup.cs # Auto-setup workflow files
├── Runtime/
│ ├── FileUtility.cs # File operations (ZIP creation)
│ └── UpdateChecker.cs # Auto-update functionality
├── Resources/
│ └── workflows.zip # Bundled GitHub Actions workflows
└── README.md # This file
Common issues and quick fixes:
Problem: DMG workflow fails to trigger Solutions:
- Verify GitHub repository URL and token are configured
- Ensure workflow files exist in
.github/workflows/ - Check repository permissions for the GitHub token
Problem: DMG creation workflow fails Solutions:
- Check GitHub Actions logs for detailed error messages
- Verify the macOS ZIP file exists in the release
- Ensure the ZIP contains a valid .app bundle
Problem: Build fails with license error Solution:
- Verify
UNITY_LICENSE,UNITY_EMAIL,UNITY_PASSWORDsecrets - Ensure license supports target platforms
Problem: macOS DMG creation fails in GitHub Actions Solution:
- Check the workflow log for create-dmg installation
- Verify GitHub secrets are properly configured (P12_CERT, P12_PASSWORD)
- The workflow will automatically fall back to ad-hoc signing if certificate issues occur
- DMG creation will fall back to ZIP if all methods fail
Problem: Code signing hangs or times out Solution:
- The workflow now includes automatic timeout protection (30-120 seconds)
- Check GitHub Actions logs for specific timeout errors
- Verify certificate format and password are correct
Problem: Build fails on specific platform Solutions:
- Ensure platform module is installed
- Check build profiles configuration
- Verify PlayerSettings for target platform
- Fork the repository
- Create a feature branch
- Make your changes
- Test on multiple platforms
- Submit a pull request
MIT