-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·176 lines (143 loc) · 6.57 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·176 lines (143 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────────────
# release.sh — Push voice-email v2.0.0 and create a GitHub Release
#
# Requirements:
# - git
# - GitHub CLI (gh): https://cli.github.com → brew install gh OR
# winget install GitHub.cli
#
# Usage:
# chmod +x release.sh
# ./release.sh
# ─────────────────────────────────────────────────────────────────────────────
set -e # exit on any error
REPO="hacky1997/voice-based-email-for-blind"
TAG="v2.0.0"
TITLE="v2.0.0 — Complete Rewrite: PWA + OAuth2 + Multi-provider IMAP"
# ── 1. Sanity checks ──────────────────────────────────────────────────────────
echo "🔍 Checking dependencies..."
if ! command -v git &>/dev/null; then
echo "❌ git not found. Install git first."; exit 1
fi
if ! command -v gh &>/dev/null; then
echo "❌ GitHub CLI (gh) not found."
echo " Install: https://cli.github.com"
echo ""
echo " macOS: brew install gh"
echo " Windows: winget install GitHub.cli"
echo " Linux: https://github.com/cli/cli/releases"
exit 1
fi
# Check gh auth
if ! gh auth status &>/dev/null; then
echo "🔑 Not logged in to GitHub CLI. Running: gh auth login"
gh auth login
fi
echo "✅ All checks passed."
echo ""
# ── 2. Stage & commit ─────────────────────────────────────────────────────────
echo "📦 Staging all files..."
git add -A
# Only commit if there are staged changes
if git diff --cached --quiet; then
echo " (nothing new to commit — files already staged)"
else
git commit -m "feat: v2.0.0 complete rewrite
- Replace broken SMTP auth with Gmail OAuth2 + App Passwords
- Add PWA (installable on any phone via browser)
- Modular Flask backend with proper REST API
- Full IMAP support: Gmail, Yahoo, generic providers
- New features: reply, delete, mark as read, contact book
- Voice commands via Web Speech API (no server-side audio)
- Docker + Caddy for automatic HTTPS (required for mobile voice)
- 45 tests across API, contacts, and email utilities
- CircleCI pipeline: lint → test → Docker smoke test
- Makefile for developer convenience
- DEPLOY.md covering Railway, Fly.io, local, LAN, Docker"
fi
# ── 3. Tag ────────────────────────────────────────────────────────────────────
echo ""
echo "🏷 Creating tag $TAG..."
# Delete tag locally and remotely if it already exists (safe re-run)
git tag -d "$TAG" 2>/dev/null || true
git push origin ":refs/tags/$TAG" 2>/dev/null || true
git tag -a "$TAG" -m "Release $TAG"
# ── 4. Push ───────────────────────────────────────────────────────────────────
echo ""
echo "🚀 Pushing to GitHub..."
# Detect current branch name (could be master, main, or anything)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo " Branch detected: $BRANCH"
# If repo has no commits yet, this is the very first push
if ! git rev-parse HEAD &>/dev/null; then
echo "❌ No commits found. Make sure files are staged and committed."
exit 1
fi
# Rename to main if currently on master (GitHub default is now main)
if [ "$BRANCH" = "master" ]; then
echo " Renaming branch master → main..."
git branch -m master main
BRANCH="main"
fi
git push -u origin "$BRANCH"
git push origin "$TAG"
# ── 5. Create GitHub Release ──────────────────────────────────────────────────
echo ""
echo "📝 Creating GitHub Release $TAG..."
gh release create "$TAG" \
--repo "$REPO" \
--title "$TITLE" \
--target "$BRANCH" \
--notes "## What's New in v2.0.0
This is a **complete rewrite** of the original 2019 voice email project.
### 🔐 Authentication
- **Gmail** — Proper OAuth2 via Google API (no password ever stored)
- **Yahoo Mail** — App Password support over IMAP/SMTP
- **Any IMAP provider** — Generic IMAP/SMTP with configurable host/port
### 📱 Progressive Web App (Mobile)
- Installable on **any phone** via browser (no app store)
- Works on Android (Chrome) and iOS (Safari)
- Voice input via **Web Speech API** — no server-side audio files
- Offline shell caching via Service Worker
- Dark, accessible UI optimised for touch
### ✉️ Email Features
- Send email by voice or keyboard
- Read inbox with sender, subject, and body
- **Read email aloud** using text-to-speech
- **Reply** to emails by voice
- **Delete** emails (moves to trash)
- **Mark as read**
- **Contact book** with voice-search autocomplete
### 🏗 Architecture
- Modular Flask REST API backend
- Separate \`auth/\`, \`email_client/\` packages
- Environment-based config via \`.env\` (no hardcoded credentials)
- Docker + Caddy for automatic HTTPS
- Deployable to Railway or Fly.io in ~5 minutes
### 🧪 Tests
- 45 tests across API routes, contact CRUD, and email utilities
- Fully mocked — no real email account needed to run tests
- \`make test\` or \`make test-cov\` for coverage report
### ⚙️ CI/CD
- CircleCI pipeline: **lint → test → Docker smoke test**
- Docker image built and validated on every \`main\` push
---
### Quick Start
\`\`\`bash
git clone https://github.com/hacky1997/voice-based-email-for-blind.git
cd voice-based-email-for-blind
make install # creates venv, installs deps, copies .env.example
# edit .env with your credentials
make run # http://localhost:5000
\`\`\`
See [DEPLOY.md](DEPLOY.md) for mobile HTTPS setup, Docker, Railway, and Fly.io.
---
### Breaking Changes from v1
- Google removed \"Less Secure Apps\" support in 2024 — the old SMTP auth no longer works. Use OAuth2 (Gmail) or an App Password (Yahoo/others).
- \`pyglet\` and temp MP3 files replaced by the browser's built-in speech engine.
- Credentials must be in \`.env\` — never in source code." \
--latest
echo ""
echo "✅ Done! Release published:"
echo " https://github.com/$REPO/releases/tag/$TAG"