Publishing¶
Nucleus can publish your installers and update metadata to GitHub Releases or Amazon S3.
Configuration¶
nativeDistributions {
publish {
// Publish mode
publishMode = PublishMode.Auto // Never, Auto, Always
github {
enabled = true
owner = "myorg"
repo = "myapp"
token = System.getenv("GITHUB_TOKEN")
channel = ReleaseChannel.Latest
releaseType = ReleaseType.Release
}
// Or S3
s3 {
enabled = true
bucket = "my-updates-bucket"
region = "us-east-1"
path = "releases"
acl = "public-read"
}
}
}
GitHub Releases¶
The most common publishing target. Installers and YML metadata files are uploaded as release assets.
publish {
github {
enabled = true
owner = "myorg" // GitHub org or user
repo = "myapp" // Repository name
token = System.getenv("GITHUB_TOKEN") // Authentication token
channel = ReleaseChannel.Latest // Latest, Beta, Alpha
releaseType = ReleaseType.Release // Release, Draft, Prerelease
}
}
Release Structure¶
A GitHub Release created by Nucleus contains:
v1.0.0 (Release)
├── MyApp-1.0.0-macos-arm64.dmg
├── MyApp-1.0.0-macos-amd64.dmg
├── MyApp-1.0.0-macos-universal.dmg
├── MyApp-1.0.0-windows-amd64.exe
├── MyApp-1.0.0-windows-arm64.exe
├── MyApp-1.0.0-windows.msixbundle
├── MyApp-1.0.0-linux-amd64.deb
├── MyApp-1.0.0-linux-arm64.deb
├── MyApp-1.0.0-linux-amd64.rpm
├── MyApp-1.0.0-linux-amd64.AppImage
├── latest-mac.yml ← Auto-update metadata
├── latest.yml ← Auto-update metadata (Windows)
└── latest-linux.yml ← Auto-update metadata
GitHub Token¶
Use a GITHUB_TOKEN with contents: write permission:
# GitHub Actions — automatic token
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Amazon S3¶
Publish to an S3 bucket for self-hosted update distribution:
publish {
s3 {
enabled = true
bucket = "my-updates-bucket"
region = "us-east-1"
path = "releases/myapp" // Prefix path in the bucket
acl = "public-read" // ACL for uploaded files
}
}
S3 Bucket Structure¶
s3://my-updates-bucket/releases/myapp/
├── MyApp-1.0.0-macos-arm64.dmg
├── MyApp-1.0.0-windows-amd64.exe
├── MyApp-1.0.0-linux-amd64.deb
├── latest-mac.yml
├── latest.yml
└── latest-linux.yml
S3 Authentication¶
Set AWS credentials via environment variables:
Release Channels¶
Channels allow you to distribute pre-release versions to testers:
| Channel | YML Prefix | Version Pattern | Audience |
|---|---|---|---|
ReleaseChannel.Latest |
latest- |
1.0.0 |
All users |
ReleaseChannel.Beta |
beta- |
1.0.0-beta.1 |
Beta testers |
ReleaseChannel.Alpha |
alpha- |
1.0.0-alpha.1 |
Internal testers |
Users on the beta channel receive both latest and beta updates. Users on the alpha channel receive all updates.
Configure the channel in the updater runtime:
NucleusUpdater {
provider = GitHubProvider(owner = "myorg", repo = "myapp")
channel = "beta" // Subscribe to beta updates
}
Release Types¶
| Type | Description |
|---|---|
ReleaseType.Release |
Visible on the releases page |
ReleaseType.Draft |
Hidden until manually published |
ReleaseType.Prerelease |
Marked as pre-release |
Publish Modes¶
| Mode | Description |
|---|---|
PublishMode.Never |
Do not publish (build only) |
PublishMode.Auto |
Publish if on CI, skip locally |
PublishMode.Always |
Always publish |
DSL Reference¶
publish { }¶
| Property | Type | Default | Description |
|---|---|---|---|
publishMode |
PublishMode |
Never |
When to publish |
publish { github { } }¶
| Property | Type | Default | Description |
|---|---|---|---|
enabled |
Boolean |
false |
Enable GitHub publishing |
owner |
String |
— | GitHub owner/org |
repo |
String |
— | Repository name |
token |
String? |
null |
GitHub token |
channel |
ReleaseChannel |
Latest |
Release channel |
releaseType |
ReleaseType |
Release |
Release type |
publish { s3 { } }¶
| Property | Type | Default | Description |
|---|---|---|---|
enabled |
Boolean |
false |
Enable S3 publishing |
bucket |
String |
— | S3 bucket name |
region |
String |
— | AWS region |
path |
String? |
null |
Key prefix |
acl |
String? |
null |
S3 ACL |