diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c608fe3..9d34ab5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,9 @@ name: CI on: push: - branches: [main, develop] + branches: [main] pull_request: - branches: [main, develop] + branches: [main] env: NODE_VERSION: '20' @@ -167,7 +167,7 @@ jobs: STATUS="❌ FAILED" EMOJI="🚨" fi - + MESSAGE="${EMOJI} *GoRec CI* ${STATUS} 📦 *Repository:* ${{ github.repository }} @@ -180,7 +180,7 @@ jobs: 🔒 *Security:* ${{ needs.security.result }} [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" - + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -d chat_id="${TELEGRAM_CHAT_ID}" \ -d parse_mode="Markdown" \ diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml deleted file mode 100644 index 4b69509..0000000 --- a/.github/workflows/deploy-staging.yml +++ /dev/null @@ -1,100 +0,0 @@ -# Deploy to Staging Workflow -# Deploys develop branch to staging environment - -name: Deploy Staging - -on: - push: - branches: [develop] - -env: - NODE_VERSION: '20' - -jobs: - deploy-staging: - name: Deploy to Staging - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Run security audit - run: node supabase/security-audit.js - env: - SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} - SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }} - continue-on-error: true - - - name: Build application - run: pnpm build - env: - VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} - VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }} - - - name: Deploy to Netlify (Staging) - uses: nwtgck/actions-netlify@v3.0 - with: - publish-dir: './dist' - production-branch: main - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: 'Deploy from GitHub Actions - Staging' - alias: staging - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - - - name: Send Telegram notification - if: always() - env: - TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} - TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} - run: | - if [[ "${{ job.status }}" == "success" ]]; then - STATUS="✅ SUCCESS" - EMOJI="🚀" - else - STATUS="❌ FAILED" - EMOJI="🚨" - fi - - MESSAGE="${EMOJI} *GoRec Staging Deploy* ${STATUS} - - 📦 *Repository:* ${{ github.repository }} - 🌿 *Branch:* ${{ github.ref_name }} - 👤 *Author:* ${{ github.actor }} - 📝 *Commit:* \`${{ github.sha }}\` - - 🌐 *Staging URL:* https://staging--gorec.netlify.app - - [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" - - curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ - -d chat_id="${TELEGRAM_CHAT_ID}" \ - -d parse_mode="Markdown" \ - -d text="${MESSAGE}" || true - - - name: Comment deployment URL - if: github.event_name == 'pull_request' - uses: actions/github-script@v7 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '🚀 Staging deployment ready: https://staging--gorec.netlify.app' - }) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3bdcc7d..9168532 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -40,14 +40,14 @@ By participating in this project, you agree to maintain a respectful and inclusi 2. **Clone your fork** ```bash - git clone https://github.com/YOUR_USERNAME/screen-recorder.git - cd screen-recorder + git clone https://github.com/YOUR_USERNAME/GoRec.git + cd GoRec ``` 3. **Add upstream remote** ```bash - git remote add upstream https://github.com/Abdelkaderbzz/screen-recorder.git + git remote add upstream https://github.com/Abdelkaderbzz/GoRec.git ``` 4. **Install dependencies** @@ -63,6 +63,23 @@ By participating in this project, you agree to maintain a respectful and inclusi ## Development Workflow +We use **GitHub Flow** - a simple, branch-based workflow: + +``` +main (always deployable) + ↑ + └── feature/your-feature ← You work here +``` + +### Workflow Steps + +1. **Create a branch** from `main` +2. **Make changes** and commit +3. **Open a Pull Request** to `main` +4. **Review, discuss, and iterate** +5. **Merge** after approval +6. **Delete** your feature branch + ### Branch Naming Use descriptive branch names: @@ -365,7 +382,7 @@ async function startCapture(options: DisplayMediaOptions): Promise { ## Questions? -- Open a [GitHub Issue](https://github.com/Abdelkaderbzz/screen-recorder/issues) -- Start a [Discussion](https://github.com/Abdelkaderbzz/screen-recorder/discussions) +- Open a [GitHub Issue](https://github.com/Abdelkaderbzz/GoRec/issues) +- Start a [Discussion](https://github.com/Abdelkaderbzz/GoRec/discussions) Thank you for contributing! 🎉 diff --git a/docs/RELEASE_STRATEGY.md b/docs/RELEASE_STRATEGY.md index 3958793..e9f9251 100644 --- a/docs/RELEASE_STRATEGY.md +++ b/docs/RELEASE_STRATEGY.md @@ -14,48 +14,45 @@ --- -## 🌳 Branch Strategy (GitFlow Simplified) +## 🌳 Branch Strategy (GitHub Flow) ``` -main (production) +main (production - always deployable) ↑ - └── develop (staging/integration) - ↑ - ├── feature/screen-annotation - ├── feature/cloud-sync - ├── fix/upload-timeout - └── hotfix/security-patch + ├── feature/screen-annotation + ├── feature/cloud-sync + ├── fix/upload-timeout + └── hotfix/security-patch ``` ### Branch Rules: -| Branch | Purpose | Deploys To | Protection | -| ----------- | ------------------------- | --------------------------- | ------------------------------- | -| `main` | Production releases | Production (gorec.app) | Require PR, 1 approval, CI pass | -| `develop` | Integration & staging | Staging (staging.gorec.app) | Require PR, CI pass | -| `feature/*` | New features | Preview (PR previews) | None | -| `fix/*` | Bug fixes | Preview | None | -| `hotfix/*` | Critical production fixes | Fast-track to main | 1 approval | +| Branch | Purpose | Deploys To | Protection | +| ----------- | ------------------------- | ---------------------- | ------------------------------- | +| `main` | Production releases | Production (gorec.app) | Require PR, 1 approval, CI pass | +| `feature/*` | New features | Preview (PR previews) | None | +| `fix/*` | Bug fixes | Preview | None | +| `hotfix/*` | Critical production fixes | Fast-track to main | 1 approval | --- ## 📦 Release Types -### 1. Regular Release (Weekly/Bi-weekly) +### 1. Regular Release (Continuous) ``` -feature/* → develop → main +feature/* → main (via PR) ``` -- Accumulate features in `develop` -- Test on staging environment -- Create release PR to `main` +- Create feature branch from `main` +- Open PR when ready +- After review and CI pass, merge to `main` - Tag with version (v1.2.0) ### 2. Hotfix Release (As needed) ``` -hotfix/* → main (and back-merge to develop) +hotfix/* → main ``` - Critical security or breaking bugs only @@ -65,11 +62,11 @@ hotfix/* → main (and back-merge to develop) ### 3. Beta/Preview Release ``` -develop → beta tag (v1.3.0-beta.1) +main → beta tag (v1.3.0-beta.1) ``` - For testing new features with select users -- Deploy to beta.gorec.app +- Use pre-release tags --- @@ -78,45 +75,28 @@ develop → beta tag (v1.3.0-beta.1) ### Phase 1: Development (Continuous) ```bash -# Create feature branch -git checkout develop -git pull origin develop +# Create feature branch from main +git checkout main +git pull origin main git checkout -b feature/new-feature # Work on feature... git commit -m "feat: add screen annotation" -# Push and create PR to develop +# Push and create PR to main git push origin feature/new-feature -gh pr create --base develop +gh pr create --base main ``` -### Phase 2: Staging (Pre-release) +### Phase 2: Review & Testing ```bash -# After PR merged to develop -# Automatic deployment to staging.gorec.app -# QA testing period: 2-3 days minimum -``` - -### Phase 3: Release Preparation - -```bash -# Create release branch (optional for larger releases) -git checkout develop -git checkout -b release/v1.2.0 - -# Update version -npm version minor -m "chore: bump version to %s" - -# Update CHANGELOG.md -# Final testing - -# Merge to main -gh pr create --base main --title "Release v1.2.0" +# PR triggers CI checks +# Code review by maintainers +# Preview deployment for testing (if configured) ``` -### Phase 4: Production Release +### Phase 3: Merge & Release ```bash # After PR approved and merged @@ -131,13 +111,12 @@ git push origin v1.2.0 gh release create v1.2.0 --title "v1.2.0" --notes-file RELEASE_NOTES.md ``` -### Phase 5: Post-release +### Phase 4: Cleanup ```bash -# Back-merge main to develop -git checkout develop -git merge main -git push origin develop +# Delete merged feature branch +git branch -d feature/new-feature +git push origin --delete feature/new-feature ``` --- @@ -186,7 +165,6 @@ After stable release: - [ ] PR approved by at least 1 reviewer - [ ] CI/CD pipeline green -- [ ] Staging environment tested - [ ] Release notes prepared ### After Release @@ -196,18 +174,17 @@ After stable release: - [ ] Monitoring dashboards checked - [ ] Team notified - [ ] Social media announcement (major releases) -- [ ] Back-merge to develop +- [ ] Feature branch deleted --- ## 🚀 Deployment Environments -| Environment | URL | Branch | Auto-deploy | -| ----------- | ----------------- | ----------- | ----------- | -| Development | localhost:8080 | any | Manual | -| Preview | pr-123.gorec.app | PR branches | On PR | -| Staging | staging.gorec.app | develop | On merge | -| Production | gorec.app | main | On tag | +| Environment | URL | Branch | Auto-deploy | +| ----------- | ---------------- | ----------- | ----------- | +| Development | localhost:8080 | any | Manual | +| Preview | pr-123.gorec.app | PR branches | On PR | +| Production | gorec.app | main | On tag | ---