-
Notifications
You must be signed in to change notification settings - Fork 913
add auto update #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add auto update #203
Changes from all commits
16ba414
2cf436e
c34f250
246b16e
13e3fe8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,154 +1,76 @@ | ||
| # Desktop App Release Process | ||
|
|
||
| This document describes how to create a release for the Superset Desktop application. | ||
| ## Quick Start | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Ensure all changes are committed and pushed to the repository | ||
| - Ensure the build works locally: `bun run package` | ||
| - Update version in `package.json` if needed | ||
|
|
||
| ## Release Methods | ||
|
|
||
| ### Method 1: Tag-Based Release (Recommended) | ||
|
|
||
| Create and push a git tag with the format `desktop-v*.*.*`: | ||
| From the monorepo root: | ||
|
|
||
| ```bash | ||
| # Create a tag (e.g., desktop-v1.0.0) | ||
| git tag desktop-v1.0.0 | ||
|
|
||
| # Push the tag to trigger the release workflow | ||
| git push origin desktop-v1.0.0 | ||
| ./apps/desktop/create-release.sh <version> | ||
| # Example: ./apps/desktop/create-release.sh desktop-v0.0.1 | ||
| ``` | ||
|
|
||
| This will automatically: | ||
| 1. Build the app for macOS (arm64), Windows (x64), and Linux (x64) | ||
| 2. Create artifacts for each platform | ||
| 3. Create a draft GitHub release with all binaries attached | ||
|
|
||
| ### Method 2: Manual Workflow Dispatch | ||
|
|
||
| You can also trigger a release manually from GitHub Actions: | ||
| The script will: | ||
| 1. Update `package.json` version | ||
| 2. Create and push a `desktop-v<version>` tag | ||
| 3. Monitor the GitHub Actions build | ||
| 4. Create a **draft release** for review | ||
|
|
||
| 1. Go to Actions → Release Desktop App | ||
| 2. Click "Run workflow" | ||
| 3. Enter the version number (e.g., `1.0.0`) | ||
| 4. Click "Run workflow" | ||
| To auto-publish instead of creating a draft: | ||
|
|
||
| This method is useful for testing the workflow or creating builds without creating a tag. | ||
|
|
||
| ## Workflow Overview | ||
|
|
||
| The release workflow (`.github/workflows/release-desktop.yml`) performs the following: | ||
|
|
||
| ### Build Platform | ||
|
|
||
| Builds are created for: | ||
| - **macOS**: arm64 (Apple Silicon) - produces `.dmg` and `.zip` | ||
| ```bash | ||
| ./apps/desktop/create-release.sh desktop-v0.0.1 --publish | ||
| ``` | ||
|
|
||
| ### Build Steps | ||
| To publish a draft: | ||
|
|
||
| 1. Checkout code | ||
| 2. Setup Bun | ||
| 3. Install dependencies | ||
| 4. Clean dev folder (`bun run clean:dev`) | ||
| 5. Compile app with electron-vite (`bun run compile:app`) | ||
| 6. Package with electron-builder (`bun run package`) | ||
| 7. Upload artifacts | ||
| ```bash | ||
| gh release edit desktop-v0.0.1 --draft=false | ||
| ``` | ||
|
|
||
| ### Release Creation | ||
| ### Requirements | ||
|
|
||
| After the build completes (tag-based releases only): | ||
| 1. Downloads all artifacts | ||
| 2. Creates a draft GitHub release | ||
| 3. Attaches all binaries to the release | ||
| 4. Generates release notes from commits | ||
| - GitHub CLI (`gh`) installed and authenticated | ||
| - Clean git working directory | ||
|
|
||
| ## Code Signing (Optional) | ||
| ## Manual Release | ||
|
|
||
| To enable macOS code signing, add the following secrets to your GitHub repository: | ||
| If you prefer not to use the script: | ||
|
|
||
| ```yaml | ||
| CSC_LINK: ${{ secrets.MAC_CERTIFICATE }} | ||
| CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }} | ||
| APPLEID: ${{ secrets.APPLE_ID }} | ||
| APPLEIDPASS: ${{ secrets.APPLE_ID_PASSWORD }} | ||
| ```bash | ||
| git tag desktop-v1.0.0 | ||
| git push origin desktop-v1.0.0 | ||
| ``` | ||
|
|
||
| Then uncomment the environment variables in the workflow under "Build Electron app". | ||
|
|
||
| ## Publishing the Release | ||
| This creates a draft release. Publish it manually at GitHub Releases. | ||
|
|
||
| 1. After the workflow completes, go to GitHub Releases | ||
| 2. Find the draft release | ||
| 3. Review the release notes and binaries | ||
| 4. Edit the release description if needed | ||
| 5. Click "Publish release" to make it public | ||
| ## Auto-update | ||
|
|
||
| ## Build Outputs | ||
| The app checks for updates at launch and every x hours using: | ||
|
|
||
| ### macOS (arm64) | ||
| - `Superset-<version>-arm64.dmg` - DMG installer | ||
| - `Superset-<version>-arm64-mac.zip` - Zipped app bundle | ||
|
|
||
| ## Troubleshooting | ||
| - **Manifest**: `https://github.com/superset-sh/superset/releases/latest/download/latest-mac.yml` | ||
| - **Installer**: `https://github.com/superset-sh/superset/releases/latest/download/Superset-arm64.dmg` | ||
|
|
||
| ### Build fails on macOS | ||
| The workflow creates stable-named copies (without version) so these URLs always point to the latest build. | ||
|
Comment on lines
+46
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n 'UPDATE_CHECK_INTERVAL_MS' apps/desktop/src/main/lib/auto-updater.ts -A 2 -B 2Repository: superset-sh/superset Length of output: 407 Correct auto-update interval documentation from 6 hours to 1 hour. Line 48 states the app checks for updates "every 6 hours," but the implementation in 🤖 Prompt for AI Agents |
||
|
|
||
| - Ensure you're building for the correct architecture (arm64 is configured by default) | ||
| - Check that icon files exist at `src/resources/build/icons/icon.icns` | ||
| - Verify that dependencies are properly installed | ||
| ## Code Signing | ||
|
|
||
| ### Native module errors | ||
| macOS code signing uses these repository secrets: | ||
|
|
||
| - `node-pty` is configured as a native module in both `electron.vite.config.ts` and `electron-builder.ts` | ||
| - It's externalized during build and unpacked from ASAR | ||
| - If you add more native modules, update both configuration files | ||
|
|
||
| ### Missing icons error | ||
|
|
||
| - The macOS build requires `icon.icns` in `src/resources/build/icons/` | ||
| - Ensure this file is committed to the repository | ||
| - `MAC_CERTIFICATE` / `MAC_CERTIFICATE_PASSWORD` | ||
| - `APPLE_ID` / `APPLE_ID_PASSWORD` / `APPLE_TEAM_ID` | ||
|
|
||
| ## Local Testing | ||
|
|
||
| To test the build locally before releasing: | ||
|
|
||
| ```bash | ||
| cd apps/desktop | ||
|
|
||
| # Clean and compile | ||
| bun run clean:dev | ||
| bun run compile:app | ||
|
|
||
| # Package the app | ||
| bun run package | ||
| ``` | ||
|
|
||
| The output will be in `apps/desktop/release/`. | ||
|
|
||
| ## Building for Intel Macs (x64) | ||
|
|
||
| To also build for Intel Macs, update `electron-builder.ts`: | ||
|
|
||
| ```typescript | ||
| mac: { | ||
| target: [ | ||
| { | ||
| target: "default", | ||
| arch: ["arm64", "x64"], // Add x64 for Intel Macs | ||
| }, | ||
| ], | ||
| } | ||
| ``` | ||
|
|
||
| Note: This will increase build time significantly. | ||
| Output: `apps/desktop/release/` | ||
|
|
||
| ## Adding Windows/Linux Builds | ||
|
|
||
| Currently only macOS builds are supported in CI/CD. To add Windows or Linux: | ||
| ## Troubleshooting | ||
|
|
||
| 1. Add PNG icon files to `src/resources/build/icons/` (for Linux) | ||
| 2. Update the workflow matrix in `.github/workflows/release-desktop.yml` | ||
| 3. Update `electron-builder.ts` configuration as needed | ||
| - **Build fails**: Check `src/resources/build/icons/icon.icns` exists | ||
| - **Native module errors**: Ensure `node-pty` is in externals in both `electron.vite.config.ts` and `electron-builder.ts` | ||
Uh oh!
There was an error while loading. Please reload this page.