|
| 1 | +# GitHub Workflows Documentation |
| 2 | + |
| 3 | +This document explains the GitHub Actions workflows configured for Study Buddy. |
| 4 | + |
| 5 | +## Workflows Overview |
| 6 | + |
| 7 | +### 1. Build and Test (`build.yml`) |
| 8 | +**Triggers**: Push to `main`/`develop`, Pull Requests to `main` |
| 9 | + |
| 10 | +**What it does**: |
| 11 | +- Tests on Node.js 18.x and 20.x |
| 12 | +- Runs linting and builds Next.js app |
| 13 | +- Builds Electron apps for all platforms (macOS, Windows, Linux) |
| 14 | +- Uploads build artifacts for 30 days |
| 15 | + |
| 16 | +**Platforms**: |
| 17 | +- **macOS**: `.dmg` (Intel + Apple Silicon) |
| 18 | +- **Windows**: `.exe` installer + portable `.exe` |
| 19 | +- **Linux**: `.AppImage` + `.deb` package |
| 20 | + |
| 21 | +### 2. Release (`release.yml`) |
| 22 | +**Triggers**: Git tags matching `v*.*.*` (e.g., `v1.0.0`) |
| 23 | + |
| 24 | +**What it does**: |
| 25 | +- Builds production releases for all platforms |
| 26 | +- Creates GitHub release with auto-generated release notes |
| 27 | +- Uploads distribution files as release assets |
| 28 | + |
| 29 | +**To create a release**: |
| 30 | +```bash |
| 31 | +git tag v1.0.0 |
| 32 | +git push origin v1.0.0 |
| 33 | +``` |
| 34 | + |
| 35 | +### 3. PR Checks (`pr-check.yml`) |
| 36 | +**Triggers**: Pull Requests to `main` |
| 37 | + |
| 38 | +**What it does**: |
| 39 | +- Runs comprehensive code quality checks |
| 40 | +- ESLint, TypeScript checking, formatting |
| 41 | +- Security audit and dependency checks |
| 42 | +- Ensures PRs meet quality standards |
| 43 | + |
| 44 | +## Code Signing (Optional) |
| 45 | + |
| 46 | +For production releases, you can add code signing certificates as repository secrets: |
| 47 | + |
| 48 | +### macOS Code Signing |
| 49 | +``` |
| 50 | +CSC_LINK=<base64-encoded-p12-certificate> |
| 51 | +CSC_KEY_PASSWORD=<certificate-password> |
| 52 | +APPLE_ID=<your-apple-id> |
| 53 | +APPLE_ID_PASS=<app-specific-password> |
| 54 | +APPLE_TEAM_ID=<your-team-id> |
| 55 | +``` |
| 56 | + |
| 57 | +### Windows Code Signing |
| 58 | +``` |
| 59 | +WIN_CSC_LINK=<base64-encoded-p12-certificate> |
| 60 | +WIN_CSC_KEY_PASSWORD=<certificate-password> |
| 61 | +``` |
| 62 | + |
| 63 | +## Build Outputs |
| 64 | + |
| 65 | +### macOS |
| 66 | +- `StudyBuddy-x.x.x.dmg` - Universal installer (Intel + Apple Silicon) |
| 67 | +- `StudyBuddy-x.x.x-arm64.dmg` - Apple Silicon only |
| 68 | +- `StudyBuddy-x.x.x-x64.dmg` - Intel only |
| 69 | + |
| 70 | +### Windows |
| 71 | +- `StudyBuddy Setup x.x.x.exe` - NSIS installer |
| 72 | +- `StudyBuddy x.x.x.exe` - Portable executable |
| 73 | + |
| 74 | +### Linux |
| 75 | +- `StudyBuddy-x.x.x.AppImage` - Universal Linux app |
| 76 | +- `study-buddy_x.x.x_amd64.deb` - Debian/Ubuntu package |
| 77 | + |
| 78 | +## Workflow Status |
| 79 | + |
| 80 | +Check workflow status at: `https://github.com/michael-borck/study-buddy/actions` |
| 81 | + |
| 82 | +## Development Tips |
| 83 | + |
| 84 | +### Local Testing |
| 85 | +```bash |
| 86 | +# Test Next.js build |
| 87 | +npm run build |
| 88 | + |
| 89 | +# Test Electron build (current platform only) |
| 90 | +npm run dist |
| 91 | + |
| 92 | +# Run linting |
| 93 | +npm run lint |
| 94 | +``` |
| 95 | + |
| 96 | +### Debugging Workflows |
| 97 | +- Check the Actions tab for detailed logs |
| 98 | +- Build artifacts are available for download for 30 days |
| 99 | +- Failed builds will show detailed error messages |
| 100 | + |
| 101 | +### Release Process |
| 102 | +1. Ensure all tests pass on `main` branch |
| 103 | +2. Update version in `package.json` |
| 104 | +3. Create and push a git tag |
| 105 | +4. GitHub will automatically build and create a release |
| 106 | + |
| 107 | +## Security Notes |
| 108 | + |
| 109 | +- Workflows use pinned action versions for security |
| 110 | +- Code signing certificates should be stored as encrypted secrets |
| 111 | +- npm audit is run on every PR to catch vulnerabilities |
| 112 | +- Build artifacts are automatically cleaned up after 30 days |
0 commit comments