Skip to content

Commit 9d86980

Browse files
Add semantic versioning system (v0.1.4-beta)
- Add version.ts with version info for frontend - Add bump_version.py script to manage versions - Add release.yml workflow for automatic GitHub releases - Add VERSION.md documentation - Display version in footer - Update author info in pyproject.toml Closes #12
1 parent 93e0709 commit 9d86980

File tree

7 files changed

+492
-14
lines changed

7 files changed

+492
-14
lines changed

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Create GitHub Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Get version from tag
23+
id: get_version
24+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
25+
26+
- name: Generate changelog
27+
id: changelog
28+
run: |
29+
# Get the previous tag
30+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
31+
32+
if [ -z "$PREV_TAG" ]; then
33+
# First release - get all commits
34+
CHANGELOG=$(git log --oneline --no-decorate)
35+
else
36+
# Get commits since previous tag
37+
CHANGELOG=$(git log --oneline --no-decorate ${PREV_TAG}..HEAD)
38+
fi
39+
40+
# Format changelog
41+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
42+
echo "## Changes" >> $GITHUB_OUTPUT
43+
echo "" >> $GITHUB_OUTPUT
44+
echo "$CHANGELOG" | while read line; do
45+
echo "- $line" >> $GITHUB_OUTPUT
46+
done
47+
echo "EOF" >> $GITHUB_OUTPUT
48+
49+
- name: Create Release
50+
uses: actions/create-release@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
tag_name: ${{ github.ref_name }}
55+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
56+
body: |
57+
## Image Annotation Dashboard ${{ steps.get_version.outputs.VERSION }}
58+
59+
${{ steps.changelog.outputs.CHANGELOG }}
60+
61+
---
62+
63+
### Deployment
64+
65+
The dashboard is automatically deployed to Cloudflare Pages:
66+
- **Production**: https://annotation.garden/image-annotation
67+
68+
### From Source
69+
70+
```bash
71+
git clone https://github.com/${{ github.repository }}.git
72+
cd image-annotation
73+
git checkout v${{ steps.get_version.outputs.VERSION }}
74+
75+
# Frontend
76+
cd frontend
77+
npm install
78+
npm run dev
79+
80+
# Backend (optional)
81+
pip install -e .
82+
```
83+
84+
### Documentation
85+
See [README.md](https://github.com/${{ github.repository }}/blob/main/README.md) for setup and usage instructions.
86+
draft: false
87+
prerelease: ${{ contains(steps.get_version.outputs.VERSION, 'alpha') || contains(steps.get_version.outputs.VERSION, 'beta') || contains(steps.get_version.outputs.VERSION, 'rc') }}

VERSION.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Version Management
2+
3+
Image Annotation Dashboard follows [Semantic Versioning 2.0.0](https://semver.org/).
4+
5+
## Current Version
6+
7+
**0.1.4-beta**
8+
9+
## Version Format
10+
11+
```
12+
MAJOR.MINOR.PATCH[-PRERELEASE]
13+
```
14+
15+
- **MAJOR**: Incompatible API changes
16+
- **MINOR**: New functionality (backwards-compatible)
17+
- **PATCH**: Bug fixes (backwards-compatible)
18+
- **PRERELEASE**: Optional pre-release label
19+
- `alpha`: Early testing, may have significant bugs
20+
- `beta`: Feature-complete, testing and refinement
21+
- `rc`: Release candidate, final testing before stable
22+
- Omitted for stable releases (e.g., `1.0.0`)
23+
24+
## Bumping Version
25+
26+
Use the version bump script to increment the version:
27+
28+
```bash
29+
# Patch version bump (0.1.4-beta -> 0.1.5-beta)
30+
python scripts/bump_version.py patch
31+
32+
# Minor version bump (0.1.4-beta -> 0.2.0-beta)
33+
python scripts/bump_version.py minor
34+
35+
# Major version bump (0.1.4-beta -> 1.0.0-beta)
36+
python scripts/bump_version.py major
37+
38+
# Change pre-release label
39+
python scripts/bump_version.py patch --prerelease rc # -> 0.1.5-rc
40+
python scripts/bump_version.py minor --prerelease stable # -> 0.2.0 (no label)
41+
42+
# Show current version
43+
python scripts/bump_version.py --current
44+
45+
# Skip git operations (for testing)
46+
python scripts/bump_version.py patch --no-git
47+
```
48+
49+
## Version Files
50+
51+
The bump script updates these files:
52+
- `frontend/app/version.ts` - TypeScript version module
53+
- `frontend/package.json` - npm package version
54+
- `pyproject.toml` - Python package version
55+
56+
## Workflow
57+
58+
### 1. Development in Feature Branch
59+
60+
```bash
61+
git checkout -b feature/my-feature
62+
# Make changes and commit
63+
git add .
64+
git commit -m "Add new feature"
65+
```
66+
67+
### 2. Bump Version After PR Merge
68+
69+
After your PR is merged to `main`:
70+
71+
```bash
72+
git checkout main
73+
git pull origin main
74+
75+
# Bump version (choose appropriate bump type)
76+
python scripts/bump_version.py patch # or minor/major
77+
78+
# Push commit and tag
79+
git push origin main
80+
git push origin v0.1.5-beta # replace with actual version
81+
```
82+
83+
### 3. Automatic GitHub Release
84+
85+
When you push a version tag (e.g., `v0.1.5-beta`), GitHub Actions automatically:
86+
1. Creates a GitHub Release
87+
2. Generates changelog from commits
88+
3. Marks pre-release appropriately (alpha, beta, rc)
89+
90+
## Version Display
91+
92+
The version is displayed in the frontend footer.
93+
94+
## Pre-release Guidelines
95+
96+
- **Alpha**: Active development, expect changes
97+
- **Beta**: Feature freeze, bug fixing (current stage)
98+
- **RC**: Release candidate, final testing
99+
- **Stable** (no label): Production ready
100+
101+
## Version History
102+
103+
| Version | Date | Description |
104+
|---------|------|-------------|
105+
| 0.1.4-beta | 2025-11-27 | Add semantic versioning, Cloudflare deployment |
106+
| 0.1.0 | 2025-11-24 | Initial release |

frontend/app/page.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ThumbnailRibbon from './components/ThumbnailRibbon'
66
import AnnotationViewer from './components/AnnotationViewer'
77
import { ImageData, Annotation, PromptAnnotation, PlatformInfo } from './types'
88
import { Sparkles, ChevronDown, Loader2, ExternalLink, Sun, Moon } from 'lucide-react'
9+
import { VERSION } from './version'
910

1011
export default function Dashboard() {
1112
const [images, setImages] = useState<ImageData[]>([])
@@ -344,17 +345,21 @@ export default function Dashboard() {
344345

345346
{/* Footer */}
346347
<footer className="glass-footer px-6 py-3">
347-
<div className="text-sm text-agi-teal-600 dark:text-zinc-400 text-center">
348-
© 2025{' '}
349-
<a
350-
href="https://annotation.garden"
351-
target="_blank"
352-
rel="noopener noreferrer"
353-
className="text-agi-teal dark:text-agi-teal-400 hover:text-agi-orange transition-colors inline-flex items-center gap-1"
354-
>
355-
Annotation Garden Initiative
356-
<ExternalLink className="w-3 h-3" />
357-
</a>
348+
<div className="flex items-center justify-between text-sm text-agi-teal-600 dark:text-zinc-400">
349+
<span className="text-xs font-mono opacity-60">v{VERSION}</span>
350+
<div>
351+
© 2025{' '}
352+
<a
353+
href="https://annotation.garden"
354+
target="_blank"
355+
rel="noopener noreferrer"
356+
className="text-agi-teal dark:text-agi-teal-400 hover:text-agi-orange transition-colors inline-flex items-center gap-1"
357+
>
358+
Annotation Garden Initiative
359+
<ExternalLink className="w-3 h-3" />
360+
</a>
361+
</div>
362+
<span className="text-xs opacity-0">v{VERSION}</span>
358363
</div>
359364
</footer>
360365
</main>

frontend/app/version.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Version information for Image Annotation Dashboard.
3+
*/
4+
5+
export const VERSION = "0.1.4-beta";
6+
export const VERSION_INFO = {
7+
major: 0,
8+
minor: 1,
9+
patch: 4,
10+
prerelease: "beta"
11+
} as const;
12+
13+
export function getVersion(): string {
14+
return VERSION;
15+
}
16+
17+
export function getVersionInfo() {
18+
return VERSION_INFO;
19+
}

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "image-annotation-frontend",
3-
"version": "0.1.0",
3+
"version": "0.1.4-beta",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
name = "image-annotation"
3-
version = "0.1.0"
3+
version = "0.1.4-beta"
44
description = "VLM-based image annotation system for Natural Scene Dataset"
5-
authors = [{name = "Research Team"}]
5+
authors = [{name = "Seyed Yahya Shirazi", email = "shirazi@ieee.org"}]
66
license = {text = "MIT"}
77
readme = "README.md"
88
requires-python = ">=3.11"

0 commit comments

Comments
 (0)