# Push CaDaR to GitHub - Authentication Required

## Current Status

✅ **All code is committed locally**
✅ **Release tag v0.1.0 is created**
❌ **Needs authentication to push to GitHub**

## What You Need to Do

Choose one of the following authentication methods:

---

## Option 1: GitHub CLI (Easiest) ⭐

```bash
# Install GitHub CLI if not already installed
# Ubuntu/Debian:
sudo apt install gh

# macOS:
brew install gh

# Then authenticate
gh auth login

# Follow the prompts to authenticate with your browser

# After authentication, push everything:
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"
git push -u origin main
git push origin v0.1.0
```

---

## Option 2: SSH Keys (Recommended for Long-term)

### Step 1: Generate SSH Key (if you don't have one)

```bash
ssh-keygen -t ed25519 -C "your_email@example.com"
# Press Enter to accept default location
# Enter a passphrase (optional but recommended)
```

### Step 2: Add SSH Key to GitHub

```bash
# Copy your public key
cat ~/.ssh/id_ed25519.pub
# Or use: xclip -selection clipboard < ~/.ssh/id_ed25519.pub
```

Then:
1. Go to https://github.com/settings/keys
2. Click "New SSH key"
3. Title: "CaDaR Development"
4. Paste your public key
5. Click "Add SSH key"

### Step 3: Test SSH Connection

```bash
ssh -T git@github.com
# You should see: "Hi username! You've successfully authenticated..."
```

### Step 4: Change Remote to SSH and Push

```bash
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"

# Change remote URL to SSH
git remote set-url origin git@github.com:Oit-Technologies/CaDaR.git

# Push everything
git push -u origin main
git push origin v0.1.0
```

---

## Option 3: Personal Access Token (PAT)

### Step 1: Create Personal Access Token

1. Go to https://github.com/settings/tokens
2. Click "Generate new token" → "Generate new token (classic)"
3. Name: "CaDaR Development"
4. Expiration: Choose duration
5. Select scopes:
   - ✅ **repo** (Full control of private repositories)
   - ✅ **workflow** (Update GitHub Action workflows)
6. Click "Generate token"
7. **Copy the token** (you won't see it again!)

### Step 2: Push Using Token

```bash
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"

# Push (Git will prompt for credentials)
git push -u origin main

# When prompted:
# Username: your-github-username
# Password: paste-your-personal-access-token

# Then push the tag
git push origin v0.1.0
```

---

## After Successful Push

Once you've pushed both the code and tag, **GitHub Actions will automatically**:

### 1. PyPI Publishing (5-10 minutes)
- ✅ Build wheels for Linux, macOS, Windows
- ✅ Publish to PyPI at https://pypi.org/project/cadar/
- ✅ Create GitHub release with downloadable wheels

### 2. Documentation (2-3 minutes)
- ✅ Build documentation
- ✅ Deploy to https://oit-technologies.github.io/CaDaR/
- ✅ Create versioned docs at `/versions/0.1.0/`

### 3. Monitor Progress

Watch the automation:
- **GitHub Actions**: https://github.com/Oit-Technologies/CaDaR/actions
- **PyPI Package**: https://pypi.org/project/cadar/
- **Documentation**: https://oit-technologies.github.io/CaDaR/
- **Releases**: https://github.com/Oit-Technologies/CaDaR/releases

---

## Quick Copy-Paste Commands

### After setting up GitHub CLI:
```bash
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"
git push -u origin main && git push origin v0.1.0 && echo "✓ Pushed successfully!"
```

### After setting up SSH:
```bash
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"
git remote set-url origin git@github.com:Oit-Technologies/CaDaR.git
git push -u origin main && git push origin v0.1.0 && echo "✓ Pushed successfully!"
```

---

## Verify Everything is Ready

```bash
cd "/home/ouaillaamiri/Development/Oit LAB/CaDaR"

# Check commit status
git log --oneline -3

# Check tag
git tag -l

# Check remote
git remote -v

# Check what needs to be pushed
git status
```

---

## What Happens Next?

1. **Immediate** (after push):
   - GitHub receives your code and tag
   - GitHub Actions workflows start

2. **Within 5-10 minutes**:
   - Wheels built for all platforms
   - Package published to PyPI
   - Documentation deployed to GitHub Pages
   - GitHub release created

3. **Installation available**:
   ```bash
   pip install cadar
   ```

4. **Try it out**:
   ```python
   import cadar
   print(cadar.ara2bizi("سلام", darija="Ma"))  # Output: "slam"
   ```

---

## Troubleshooting

### "Permission denied (publickey)"
- **Solution**: Your SSH key isn't added to GitHub. Follow Option 2 steps.

### "Authentication failed"
- **Solution**: Your PAT might be expired or wrong scope. Create a new one.

### "fatal: could not read Username"
- **Solution**: Use GitHub CLI (Option 1) or SSH (Option 2) instead of HTTPS.

### "Tag already exists"
- **Solution**: If you need to recreate:
  ```bash
  git tag -d v0.1.0
  git tag -a v0.1.0 -m "Release version 0.1.0"
  ```

---

## Need Help?

1. Check the [GitHub docs on authentication](https://docs.github.com/en/authentication)
2. See [SETUP_GITHUB_ACTIONS.md](SETUP_GITHUB_ACTIONS.md) for PyPI setup
3. See [RELEASE_INSTRUCTIONS.md](RELEASE_INSTRUCTIONS.md) for release process

---

**Once you push, everything else is automatic!** 🚀
