|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This project is configured with automated GitHub Actions to build and release Windows executables. |
| 4 | + |
| 5 | +## How it works |
| 6 | + |
| 7 | +1. **On every push** to `main`/`master`: The workflow builds the app to test that everything compiles correctly |
| 8 | +2. **On tag push** (version tags like `v1.0.0`): The workflow builds the app and creates a GitHub release with Windows executables |
| 9 | + |
| 10 | +## Creating a Release |
| 11 | + |
| 12 | +### Method 1: Using the release scripts (Recommended) |
| 13 | + |
| 14 | +```bash |
| 15 | +# For patch version (1.0.0 -> 1.0.1) |
| 16 | +npm run release:patch |
| 17 | + |
| 18 | +# For minor version (1.0.0 -> 1.1.0) |
| 19 | +npm run release:minor |
| 20 | + |
| 21 | +# For major version (1.0.0 -> 2.0.0) |
| 22 | +npm run release:major |
| 23 | +``` |
| 24 | + |
| 25 | +These scripts will: |
| 26 | +- Bump the version in `package.json` |
| 27 | +- Create a git tag |
| 28 | +- Push changes and tags to GitHub |
| 29 | +- Trigger the GitHub Actions workflow automatically |
| 30 | + |
| 31 | +### Method 2: Manual process |
| 32 | + |
| 33 | +```bash |
| 34 | +# Bump version manually |
| 35 | +npm version patch # or minor, major |
| 36 | + |
| 37 | +# Push changes and tags |
| 38 | +git push |
| 39 | +git push --tags |
| 40 | +``` |
| 41 | + |
| 42 | +## What gets built |
| 43 | + |
| 44 | +The GitHub Actions workflow will create: |
| 45 | +- **NSIS Installer** (`.exe`) - Standard Windows installer |
| 46 | +- **Portable Executable** (`.exe`) - Standalone executable that doesn't require installation |
| 47 | +- **MSI Package** (if configured) - Windows Installer package |
| 48 | + |
| 49 | +## Build Configuration |
| 50 | + |
| 51 | +The build configuration is in `package.json` under the `build` section: |
| 52 | + |
| 53 | +```json |
| 54 | +{ |
| 55 | + "build": { |
| 56 | + "appId": "cdc.starterkit.electron", |
| 57 | + "productName": "CDC Electron Starterkit", |
| 58 | + "win": { |
| 59 | + "target": [ |
| 60 | + { |
| 61 | + "target": "nsis", |
| 62 | + "arch": ["x64"] |
| 63 | + }, |
| 64 | + { |
| 65 | + "target": "portable", |
| 66 | + "arch": ["x64"] |
| 67 | + } |
| 68 | + ] |
| 69 | + } |
| 70 | + } |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +## GitHub Actions Workflow |
| 75 | + |
| 76 | +The workflow file is located at `.github/workflows/build-and-release.yml` and includes: |
| 77 | + |
| 78 | +- **Build job**: Runs on Windows, builds the app, uploads artifacts |
| 79 | +- **Release job**: Creates GitHub release with built executables (only on tag push) |
| 80 | +- **Build-on-push job**: Tests builds on every push without releasing |
| 81 | + |
| 82 | +## Requirements |
| 83 | + |
| 84 | +- Repository must have GitHub Actions enabled |
| 85 | +- The `GITHUB_TOKEN` is automatically provided by GitHub Actions |
| 86 | +- Repository must match the one configured in `package.json` (`codesign-cloud/cdc-electron-starterkit`) |
| 87 | + |
| 88 | +## Troubleshooting |
| 89 | + |
| 90 | +If builds fail: |
| 91 | +1. Check the GitHub Actions logs in the "Actions" tab of your repository |
| 92 | +2. Ensure all dependencies are properly listed in `package.json` |
| 93 | +3. Test the build locally with `npm run build` |
| 94 | +4. Make sure the repository name in `package.json` matches your actual repository |
| 95 | + |
| 96 | +## Local Testing |
| 97 | + |
| 98 | +To test the build process locally: |
| 99 | + |
| 100 | +```bash |
| 101 | +# Install dependencies |
| 102 | +npm ci |
| 103 | + |
| 104 | +# Build renderer |
| 105 | +npm run build:renderer |
| 106 | + |
| 107 | +# Build for Windows (requires Windows or cross-compilation setup) |
| 108 | +npm run build |
0 commit comments