|
| 1 | +# Nightly Distribution Channel Implementation Plan |
| 2 | + |
| 3 | +**Date:** 2026-01-19 |
| 4 | +**Status:** Approved for implementation |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +Add a manually-triggered GitHub Actions workflow for nightly/experimental builds, separate from the existing tagged release workflow. |
| 9 | + |
| 10 | +## Key Design Decisions |
| 11 | + |
| 12 | +1. **Manual trigger only** - Uses `workflow_dispatch` with optional inputs |
| 13 | +2. **Rolling `nightly-latest` tag** - Single pre-release that gets replaced on each build |
| 14 | +3. **Version stamping** - Temporarily modifies `package.json` for build only (e.g., `0.0.11-nightly.20260119`) |
| 15 | +4. **Pre-release flag** - Ensures auto-updater channel separation without code changes |
| 16 | +5. **No changes to existing workflow** - Stable releases continue working as-is |
| 17 | + |
| 18 | +## Files to Create |
| 19 | + |
| 20 | +### `.github/workflows/nightly.yaml` |
| 21 | + |
| 22 | +New workflow with: |
| 23 | +- `workflow_dispatch` trigger with inputs: |
| 24 | + - `version_suffix` - Optional custom suffix (defaults to date-based) |
| 25 | + - `release_notes` - Notes for the release |
| 26 | + - `replace_existing` - Whether to delete existing nightly release (default: true) |
| 27 | +- Prepare job: generates version, deletes existing nightly if needed |
| 28 | +- Build jobs: matrix build for ubuntu/macos/windows (same as release.yaml) |
| 29 | +- Release job: downloads artifacts, creates single pre-release |
| 30 | + |
| 31 | +Key differences from `release.yaml`: |
| 32 | +- Uses artifact upload/download pattern to consolidate all platform builds into one release |
| 33 | +- Sets `prerelease: true` instead of `draft: true` |
| 34 | +- Stamps version before build: `npm pkg set version="${NIGHTLY_VERSION}"` |
| 35 | +- Fixed tag `nightly-latest` that gets replaced |
| 36 | + |
| 37 | +## Workflow Structure |
| 38 | + |
| 39 | +```yaml |
| 40 | +name: Nightly Build |
| 41 | + |
| 42 | +on: |
| 43 | + workflow_dispatch: |
| 44 | + inputs: |
| 45 | + version_suffix: |
| 46 | + description: 'Version suffix (empty = auto date-based)' |
| 47 | + required: false |
| 48 | + default: '' |
| 49 | + release_notes: |
| 50 | + description: 'Release notes' |
| 51 | + required: false |
| 52 | + default: 'Experimental nightly build for testing purposes.' |
| 53 | + replace_existing: |
| 54 | + description: 'Replace existing nightly-latest release' |
| 55 | + required: false |
| 56 | + type: boolean |
| 57 | + default: true |
| 58 | + |
| 59 | +jobs: |
| 60 | + prepare: # Generate version, delete existing release |
| 61 | + build: # Matrix build (ubuntu, macos, windows) with artifact upload |
| 62 | + release: # Download artifacts, create pre-release |
| 63 | +``` |
| 64 | +
|
| 65 | +## Version Format |
| 66 | +
|
| 67 | +- Default: `{base_version}-nightly.{YYYYMMDD}` → `0.0.11-nightly.20260119` |
| 68 | +- Custom: `{base_version}-{suffix}` → `0.0.11-alpha.1` or `0.0.11-rc.1` |
| 69 | + |
| 70 | +## Release Details |
| 71 | + |
| 72 | +| Property | Value | |
| 73 | +|----------|-------| |
| 74 | +| Tag | `nightly-latest` | |
| 75 | +| Name | `Nightly Build - 0.0.11-nightly.20260119` | |
| 76 | +| Pre-release | Yes | |
| 77 | +| Draft | No | |
| 78 | + |
| 79 | +## How to Trigger |
| 80 | + |
| 81 | +**GitHub UI:** |
| 82 | +1. Go to Actions → Nightly Build → Run workflow |
| 83 | +2. Optionally customize inputs |
| 84 | +3. Click "Run workflow" |
| 85 | + |
| 86 | +**CLI:** |
| 87 | +```bash |
| 88 | +gh workflow run nightly.yaml |
| 89 | +``` |
| 90 | + |
| 91 | +## No Changes Required To |
| 92 | + |
| 93 | +- `electron-builder.yml` - Version in artifact names handled automatically |
| 94 | +- `package.json` - Base version remains unchanged in repo |
| 95 | +- `src/main/updater.ts` - Pre-release flag handles channel separation |
| 96 | +- Existing `release.yaml` - Stable workflow unchanged |
| 97 | + |
| 98 | +## Future Enhancements (Optional) |
| 99 | + |
| 100 | +If users need to opt into nightly auto-updates: |
| 101 | +1. Add `update_channel` setting in app_settings |
| 102 | +2. Modify `updater.ts` to set `allowPrerelease` based on setting |
| 103 | +3. Add UI toggle in Settings |
| 104 | + |
| 105 | +## Verification |
| 106 | + |
| 107 | +1. Trigger workflow manually from GitHub Actions |
| 108 | +2. Verify all three platform builds complete |
| 109 | +3. Check GitHub Releases for new `nightly-latest` pre-release |
| 110 | +4. Download and test installer from each platform |
| 111 | +5. Verify auto-updater on stable installs does NOT offer nightly update |
0 commit comments