Skip to content

Commit fe893b8

Browse files
committed
feat: clean up version output format
1 parent 7dba82a commit fe893b8

12 files changed

Lines changed: 633 additions & 31 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
go-version: ['1.25']
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: ${{ matrix.go-version }}
27+
28+
- name: Get dependencies
29+
run: go mod download
30+
31+
- name: Build
32+
run: go build -v ./cmd/sess
33+
34+
- name: Run go vet
35+
run: go vet ./...
36+
37+
- name: Run tests (when available)
38+
run: go test -v ./...
39+
continue-on-error: true # Don't fail build if no tests yet
40+
41+
- name: Upload build artifacts
42+
if: matrix.os == 'ubuntu-latest'
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: sess-${{ github.sha }}
46+
path: sess
47+
retention-days: 7

.github/workflows/release.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Triggers on version tags like v0.2.0, v1.0.0, etc.
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build and 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: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.25'
26+
27+
- name: Get version from tag
28+
id: get_version
29+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
30+
31+
- name: Build binaries
32+
run: |
33+
# Create dist directory
34+
mkdir -p dist
35+
36+
# Define platforms
37+
PLATFORMS=(
38+
"linux/amd64"
39+
"linux/arm64"
40+
"darwin/amd64"
41+
"darwin/arm64"
42+
"windows/amd64"
43+
"windows/arm64"
44+
)
45+
46+
for PLATFORM in "${PLATFORMS[@]}"; do
47+
GOOS=${PLATFORM%/*}
48+
GOARCH=${PLATFORM#*/}
49+
OUTPUT_NAME="sess-${GOOS}-${GOARCH}"
50+
51+
if [ "$GOOS" = "windows" ]; then
52+
OUTPUT_NAME="${OUTPUT_NAME}.exe"
53+
fi
54+
55+
echo "Building for $GOOS/$GOARCH..."
56+
# versioninfo package automatically uses git tags and commits
57+
# -s -w strips debug info for smaller binaries
58+
GOOS=$GOOS GOARCH=$GOARCH go build \
59+
-ldflags="-s -w" \
60+
-o "dist/${OUTPUT_NAME}" \
61+
./cmd/sess
62+
63+
# Create tarball/zip
64+
cd dist
65+
if [ "$GOOS" = "windows" ]; then
66+
zip "sess-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
67+
rm "${OUTPUT_NAME}"
68+
else
69+
tar czf "sess-${GOOS}-${GOARCH}.tar.gz" "${OUTPUT_NAME}"
70+
rm "${OUTPUT_NAME}"
71+
fi
72+
cd ..
73+
done
74+
75+
- name: Generate checksums
76+
run: |
77+
cd dist
78+
sha256sum * > checksums.txt
79+
cat checksums.txt
80+
81+
- name: Create Release
82+
uses: softprops/action-gh-release@v1
83+
with:
84+
files: |
85+
dist/*.tar.gz
86+
dist/*.zip
87+
dist/checksums.txt
88+
draft: false
89+
prerelease: false
90+
generate_release_notes: true
91+
body: |
92+
## Installation
93+
94+
### Linux (amd64)
95+
```bash
96+
curl -L https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-linux-amd64.tar.gz | tar xz
97+
sudo mv sess-linux-amd64 /usr/local/bin/sess
98+
```
99+
100+
### macOS (Apple Silicon)
101+
```bash
102+
curl -L https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-darwin-arm64.tar.gz | tar xz
103+
sudo mv sess-darwin-arm64 /usr/local/bin/sess
104+
```
105+
106+
### macOS (Intel)
107+
```bash
108+
curl -L https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-darwin-amd64.tar.gz | tar xz
109+
sudo mv sess-darwin-amd64 /usr/local/bin/sess
110+
```
111+
112+
### Windows (PowerShell)
113+
```powershell
114+
Invoke-WebRequest -Uri "https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-windows-amd64.zip" -OutFile "sess.zip"
115+
Expand-Archive sess.zip -DestinationPath .
116+
# Move sess-windows-amd64.exe to a directory in your PATH
117+
```
118+
119+
## What's Changed
120+
121+
See the full changelog below.
122+
123+
## Verify Installation
124+
125+
```bash
126+
sess --version
127+
```
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,20 @@ sess end
216216

217217
| Command | Status | Description |
218218
|---------|--------|-------------|
219-
| `sess start [name]` |**Available** | Start a new session, optionally linked to GitHub issue |
220-
| `sess pause` | 🚧 Planned | Pause current session |
221-
| `sess resume` | 🚧 Planned | Resume paused session |
222-
| `sess end` | 🚧 Planned | End session, commit, push, open PR |
223-
| `sess status` | 🚧 Planned | Show active session details |
224-
| `auth login` | 🚧 Planned | Authenticate with GitHub (currently uses `gh` auth) |
225-
| `config init` | 🚧 Planned | Initialize CLI in repo with custom settings |
219+
| `sess start [name]` |**MVP1** | Start a new session, optionally linked to GitHub issue |
220+
| `sess status` |**MVP1** | Show current session status with elapsed time |
221+
| `sess pause` |**MVP1** | Pause current session and stop time tracking |
222+
| `sess resume` |**MVP1** | Resume paused session and continue time tracking |
223+
| `sess projects` |**MVP1** | List all tracked projects across the system |
224+
| `sess end` | 🚧 Phase 3 | End session, commit, push, open PR |
225+
| `sess auth` | 🚧 Phase 4 | Authenticate with GitHub (currently uses `gh` auth) |
226+
| `sess config` | 🚧 Phase 4 | Initialize CLI in repo with custom settings |
226227

227228
---
228229

229230
## Roadmap
230231

231-
### Phase 1: Core Session Management (Current)
232+
### Phase 1: Core Session Management **COMPLETE**
232233

233234
- [x] Interactive TUI for session start
234235
- [x] GitHub issue selection
@@ -237,31 +238,43 @@ sess end
237238
- [x] Real-time git operation feedback
238239
- [x] Basic workflow automation
239240

240-
### Phase 2: State Persistence (Next)
241+
### Phase 2: State Persistence **COMPLETE (MVP1 - v0.2.0)**
241242

242243
**Goal:** Track session state across commands
243244

244-
- [ ] **Session Model Activation**
245-
- [ ] Store active session in `.sess-cli/session.json`
246-
- [ ] Persist: branch, issue, start time, state (active/paused)
247-
- [ ] Load session state on any command
245+
- [x] **Database Integration**
246+
- [x] SQLite database at `~/.sess-cli/sess.db`
247+
- [x] Projects table for repository tracking
248+
- [x] Sessions table for state persistence
249+
- [x] Pure Go implementation (no CGO)
248250

249-
- [ ] **`sess status` Command**
250-
- [ ] Show current session state (idle/active/paused/ended)
251-
- [ ] Display branch, linked issue, elapsed time
252-
- [ ] Show commit count, file changes
251+
- [x] **Session Model Activation**
252+
- [x] Store active session in database
253+
- [x] Persist: branch, issue, start time, state (active/paused)
254+
- [x] Load session state on any command
255+
- [x] Track elapsed time across pause/resume cycles
253256

254-
- [ ] **`sess pause` Command**
255-
- [ ] Mark session as paused
256-
- [ ] Stop time tracking
257-
- [ ] Preserve branch and context
257+
- [x] **`sess status` Command**
258+
- [x] Show current session state (idle/active/paused)
259+
- [x] Display branch, linked issue, elapsed time
260+
- [x] Show project information
258261

259-
- [ ] **`sess resume` Command**
260-
- [ ] Resume paused session
261-
- [ ] Continue time tracking
262-
- [ ] Checkout session branch if needed
262+
- [x] **`sess pause` Command**
263+
- [x] Mark session as paused
264+
- [x] Stop time tracking
265+
- [x] Preserve branch and context in database
263266

264-
### Phase 3: End-to-End Workflow
267+
- [x] **`sess resume` Command**
268+
- [x] Resume paused session
269+
- [x] Continue time tracking
270+
- [x] Auto-checkout session branch if needed
271+
272+
- [x] **`sess projects` Command**
273+
- [x] List all tracked projects globally
274+
- [x] Show session status for each project
275+
- [x] Display last used timestamps
276+
277+
### Phase 3: End-to-End Workflow 🚧 **NEXT**
265278

266279
**Goal:** Complete the session lifecycle from start to PR
267280

@@ -302,13 +315,14 @@ sess end
302315
- [ ] Default issue labels
303316
- [ ] PR template path
304317

305-
### Phase 5: Time Tracking & Analytics
318+
### Phase 5: Time Tracking & Analytics 🔄 **PARTIALLY COMPLETE**
306319

307320
**Goal:** Understand productivity patterns
308321

309-
- [ ] **Session History**
310-
- [ ] Store completed sessions in SQLite database
311-
- [ ] Track: duration, issue, branch, commits, PR link
322+
- [x] **Session History** ✅ (MVP1)
323+
- [x] Store completed sessions in SQLite database
324+
- [x] Track: duration, issue, branch, state
325+
- [ ] Track: commits, PR link (Phase 3)
312326

313327
- [ ] **Analytics Commands**
314328
- [ ] `sess history` - Show recent sessions

cmd/sess/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
package main
22

3-
import "github.com/Orctatech-Engineering-Team/Sess/internal/sess"
3+
import (
4+
"time"
5+
6+
"github.com/Orctatech-Engineering-Team/Sess/internal/sess"
7+
"github.com/earthboundkid/versioninfo/v2"
8+
)
49

510
func main() {
11+
sess.SetVersionInfo(versioninfo.Version, versioninfo.Revision, versioninfo.LastCommit.Format(time.RFC3339))
612
sess.Execute()
713
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)