|
| 1 | +# GitHub Actions Workflow Diagram |
| 2 | + |
| 3 | +## Release Workflow Flow |
| 4 | + |
| 5 | +``` |
| 6 | +┌─────────────────────────────────────────────────────────────┐ |
| 7 | +│ TRIGGER EVENT │ |
| 8 | +│ • Git tag push (v*) │ |
| 9 | +│ • Manual workflow dispatch │ |
| 10 | +└─────────────────────────────────────────────────────────────┘ |
| 11 | + ↓ |
| 12 | +┌─────────────────────────────────────────────────────────────┐ |
| 13 | +│ JOB 1: TEST │ |
| 14 | +│ Runner: ubuntu-latest │ |
| 15 | +│ ┌───────────────────────────────────────────────────────┐ │ |
| 16 | +│ │ 1. Checkout code │ │ |
| 17 | +│ │ 2. Setup Node.js 18 │ │ |
| 18 | +│ │ 3. Install dependencies (npm ci) │ │ |
| 19 | +│ │ 4. Run all unit tests (npm run test:run) │ │ |
| 20 | +│ │ 5. Upload test results/coverage │ │ |
| 21 | +│ └───────────────────────────────────────────────────────┘ │ |
| 22 | +└─────────────────────────────────────────────────────────────┘ |
| 23 | + ↓ |
| 24 | + ✅ Tests Pass? |
| 25 | + ↙ ↘ |
| 26 | + Yes No |
| 27 | + ↓ ↓ |
| 28 | + │ ❌ STOP |
| 29 | + │ (No build) |
| 30 | + ↓ |
| 31 | +┌─────────────────────────────────────────────────────────────┐ |
| 32 | +│ JOB 2: BUILD (Parallel) │ |
| 33 | +│ │ |
| 34 | +│ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ |
| 35 | +│ │ macOS Build │ │ Windows Build │ │ Linux Build │ │ |
| 36 | +│ │ macos-latest │ │ windows-latest │ │ubuntu-latest │ │ |
| 37 | +│ ├─────────────────┤ ├─────────────────┤ ├──────────────┤ │ |
| 38 | +│ │ 1. Checkout │ │ 1. Checkout │ │ 1. Checkout │ │ |
| 39 | +│ │ 2. Setup Node │ │ 2. Setup Node │ │ 2. Setup Node│ │ |
| 40 | +│ │ 3. Install deps │ │ 3. Install deps │ │ 3. Install │ │ |
| 41 | +│ │ 4. Build app │ │ 4. Build app │ │ 4. Build app │ │ |
| 42 | +│ │ 5. Build .dmg │ │ 5. Build .exe │ │ 5. Build │ │ |
| 43 | +│ │ Build .zip │ │ Build .zip │ │ .AppImage │ │ |
| 44 | +│ │ 6. Upload │ │ 6. Upload │ │ Build .deb│ │ |
| 45 | +│ │ artifacts │ │ artifacts │ │ 6. Upload │ │ |
| 46 | +│ └─────────────────┘ └─────────────────┘ └──────────────┘ │ |
| 47 | +└─────────────────────────────────────────────────────────────┘ |
| 48 | + ↓ |
| 49 | + All Builds Complete Successfully |
| 50 | + ↓ |
| 51 | +┌─────────────────────────────────────────────────────────────┐ |
| 52 | +│ JOB 3: RELEASE │ |
| 53 | +│ Runner: ubuntu-latest │ |
| 54 | +│ ┌───────────────────────────────────────────────────────┐ │ |
| 55 | +│ │ 1. Checkout code │ │ |
| 56 | +│ │ 2. Get version from tag/input │ │ |
| 57 | +│ │ 3. Download all build artifacts │ │ |
| 58 | +│ │ 4. Prepare release files │ │ |
| 59 | +│ │ 5. Create GitHub Release │ │ |
| 60 | +│ │ - Tag: v0.0.1 │ │ |
| 61 | +│ │ - Title: Release v0.0.1 │ │ |
| 62 | +│ │ - Body: Release notes │ │ |
| 63 | +│ │ - Files: All 6 installers │ │ |
| 64 | +│ └───────────────────────────────────────────────────────┘ │ |
| 65 | +└─────────────────────────────────────────────────────────────┘ |
| 66 | + ↓ |
| 67 | + ✅ COMPLETE! |
| 68 | + ↓ |
| 69 | +┌─────────────────────────────────────────────────────────────┐ |
| 70 | +│ GITHUB RELEASE CREATED │ |
| 71 | +│ • macOS: .dmg, .zip │ |
| 72 | +│ • Windows: .exe, .zip │ |
| 73 | +│ • Linux: .AppImage, .deb │ |
| 74 | +│ • Downloadable by users │ |
| 75 | +└─────────────────────────────────────────────────────────────┘ |
| 76 | +``` |
| 77 | + |
| 78 | +## Key Features |
| 79 | + |
| 80 | +### 🛡️ Safety First |
| 81 | +- **Tests run first**: If tests fail, no builds are executed |
| 82 | +- **Saves resources**: Prevents wasting ~15 minutes of build time if code is broken |
| 83 | +- **Fast feedback**: Know if tests fail within 1-2 minutes |
| 84 | + |
| 85 | +### ⚡ Parallel Builds |
| 86 | +- All 3 platforms build simultaneously |
| 87 | +- Total build time: ~5-7 minutes (vs 15-20 minutes if sequential) |
| 88 | +- Independent builds: One platform failing doesn't affect others |
| 89 | + |
| 90 | +### 📦 Automated Release |
| 91 | +- Release created automatically after successful builds |
| 92 | +- All artifacts attached to release |
| 93 | +- Release notes generated from commits |
| 94 | +- Users can download immediately |
| 95 | + |
| 96 | +## Timeline |
| 97 | + |
| 98 | +``` |
| 99 | +Minute 0: Workflow triggered |
| 100 | +Minute 1: Tests start running |
| 101 | +Minute 2: ✅ Tests complete |
| 102 | +Minute 3: All 3 build jobs start in parallel |
| 103 | + ├─ macOS build starts |
| 104 | + ├─ Windows build starts |
| 105 | + └─ Linux build starts |
| 106 | +Minute 8: Builds complete |
| 107 | +Minute 9: Release job starts |
| 108 | +Minute 10: ✅ Release created and published |
| 109 | +``` |
| 110 | + |
| 111 | +## Error Handling |
| 112 | + |
| 113 | +``` |
| 114 | +┌──────────────┐ |
| 115 | +│ Test Fails │ → ❌ Stop (no builds run) |
| 116 | +└──────────────┘ |
| 117 | +
|
| 118 | +┌──────────────┐ |
| 119 | +│ macOS Fails │ → ⚠️ Release created without macOS installers |
| 120 | +└──────────────┘ |
| 121 | +
|
| 122 | +┌──────────────┐ |
| 123 | +│ All Fail │ → ❌ No release created |
| 124 | +└──────────────┘ |
| 125 | +
|
| 126 | +┌──────────────┐ |
| 127 | +│ Release Fails│ → ⚠️ Builds succeed but release not created |
| 128 | +└──────────────┘ (artifacts still available) |
| 129 | +``` |
| 130 | + |
| 131 | +## Monitoring |
| 132 | + |
| 133 | +You can monitor the workflow: |
| 134 | +1. GitHub → Actions tab |
| 135 | +2. Click on the running workflow |
| 136 | +3. See real-time logs for each job |
| 137 | +4. Download artifacts even if release fails |
0 commit comments