Skip to content

Commit 11636b4

Browse files
authored
Merge pull request #2 from wilmoore/feat/metadata-and-packaging
feat: add GitHub Actions CI/CD and packaging infrastructure
2 parents 031cc45 + 6804af6 commit 11636b4

File tree

21 files changed

+2182
-74
lines changed

21 files changed

+2182
-74
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: macos-14
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install Rust
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- name: Install dependencies
24+
run: |
25+
brew install opencv onnxruntime pkg-config llvm
26+
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
27+
28+
- name: Check formatting
29+
run: cargo fmt --check
30+
31+
- name: Clippy
32+
run: cargo clippy -- -D warnings
33+
34+
- name: Build
35+
run: cargo build --release
36+
37+
- name: Test
38+
run: cargo test --release

.github/workflows/release.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.target }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: macos-14
20+
target: aarch64-apple-darwin
21+
artifact: scenesplit-macos-arm64
22+
- os: macos-13
23+
target: x86_64-apple-darwin
24+
artifact: scenesplit-macos-x64
25+
- os: ubuntu-22.04
26+
target: x86_64-unknown-linux-gnu
27+
artifact: scenesplit-linux-x64
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install Rust
33+
uses: dtolnay/rust-toolchain@stable
34+
with:
35+
targets: ${{ matrix.target }}
36+
37+
- name: Install dependencies (macOS)
38+
if: runner.os == 'macOS'
39+
run: |
40+
brew install opencv onnxruntime pkg-config llvm
41+
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
42+
43+
- name: Install dependencies (Linux)
44+
if: runner.os == 'Linux'
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y \
48+
libopencv-dev \
49+
clang \
50+
libclang-dev \
51+
pkg-config
52+
53+
# Download and install ONNX Runtime
54+
ONNX_VERSION="1.16.3"
55+
curl -L "https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz" | tar xz
56+
sudo mv onnxruntime-linux-x64-${ONNX_VERSION} /opt/onnxruntime
57+
echo "ORT_LIB_LOCATION=/opt/onnxruntime/lib" >> $GITHUB_ENV
58+
echo "LD_LIBRARY_PATH=/opt/onnxruntime/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
59+
60+
- name: Build
61+
run: cargo build --release --target ${{ matrix.target }}
62+
63+
- name: Package (macOS)
64+
if: runner.os == 'macOS'
65+
run: |
66+
mkdir -p dist
67+
cp target/${{ matrix.target }}/release/scenesplit dist/
68+
cd dist
69+
tar czf ../${{ matrix.artifact }}.tar.gz scenesplit
70+
71+
- name: Package (Linux)
72+
if: runner.os == 'Linux'
73+
run: |
74+
mkdir -p dist
75+
cp target/${{ matrix.target }}/release/scenesplit dist/
76+
cd dist
77+
tar czf ../${{ matrix.artifact }}.tar.gz scenesplit
78+
79+
- name: Upload artifact
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: ${{ matrix.artifact }}
83+
path: ${{ matrix.artifact }}.tar.gz
84+
85+
release:
86+
name: Create Release
87+
needs: build
88+
runs-on: ubuntu-latest
89+
permissions:
90+
contents: write
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Download artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
path: artifacts
99+
100+
- name: Create Release
101+
uses: softprops/action-gh-release@v1
102+
with:
103+
files: artifacts/**/*.tar.gz
104+
generate_release_notes: true
105+
draft: false
106+
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Rust
22
/target/
3-
Cargo.lock
43

54
# IDE
65
.idea/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"todos":[{"content":"Commit changes to feature branch","status":"completed","activeForm":"Committing changes"},{"content":"Move planning docs to .done","status":"in_progress","activeForm":"Moving planning docs"},{"content":"Create ADR for packaging decision","status":"pending","activeForm":"Creating ADR"},{"content":"Check version and bump if needed","status":"pending","activeForm":"Checking version"},{"content":"Create pull request","status":"pending","activeForm":"Creating pull request"}]}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# feat/metadata-and-packaging
2+
3+
## Items Addressed
4+
5+
- **#5** - Metadata output (E-005): ✅ Already implemented in `output.rs`
6+
- **#13** - Minimal metadata per image (US-006): ✅ Already implemented
7+
- **#6** - Packaging and distribution (E-006): ✅ GitHub Actions workflows added
8+
9+
## Implementation Details
10+
11+
### Metadata Output
12+
13+
The existing codebase already generates `metadata.json` with:
14+
- `timestamp_seconds` - Frame timestamp in seconds
15+
- `timestamp_formatted` - Human-readable timestamp (HH:MM:SS.mmm)
16+
- `segment_index` - Semantic segment identifier
17+
- `frame_index` - Original frame index from video
18+
- `filename` - Output image filename
19+
20+
This satisfies all acceptance criteria for items #5 and #13.
21+
22+
### Packaging and Distribution
23+
24+
Added GitHub Actions workflows:
25+
26+
1. **`.github/workflows/release.yml`** - Triggered on tag push (`v*`)
27+
- Builds for macOS ARM64, macOS x64, and Linux x64
28+
- Creates release with downloadable tarballs
29+
- Uses matrix strategy for parallel builds
30+
31+
2. **`.github/workflows/ci.yml`** - Triggered on PR/push to main
32+
- Runs formatting check, clippy, build, and tests
33+
34+
### README Updates
35+
36+
- Added pre-built binary installation instructions
37+
- Updated metadata.json example to match actual output format
38+
- Updated output file naming convention (0001.jpg vs frame_001.png)
39+
40+
## Files Changed
41+
42+
- `.github/workflows/release.yml` (new)
43+
- `.github/workflows/ci.yml` (new)
44+
- `README.md` (updated installation section and output examples)
45+
46+
## Next Steps
47+
48+
1. Commit and push changes
49+
2. Create a tag (e.g., `v1.1.0`) to trigger the release workflow
50+
3. Verify release artifacts on GitHub

.plan/adr-index.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lastSequence": 3,
2+
"lastSequence": 4,
33
"entries": [
44
{
55
"branch": "mvp/scenesplit",
@@ -8,6 +8,12 @@
88
"002-use-onnx-runtime-for-ml-inference.md",
99
"003-auto-download-model-on-first-run.md"
1010
]
11+
},
12+
{
13+
"branch": "feat/metadata-and-packaging",
14+
"adrs": [
15+
"004-github-actions-for-releases.md"
16+
]
1117
}
1218
]
1319
}

.plan/backlog.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@
7676
"fingerprint": "spec|spec-001|epic|e005-metadata-output",
7777
"source": "/pro:spec.import",
7878
"sourceSpec": "spec-001",
79-
"sourceBranch": null,
79+
"sourceBranch": "feat/metadata-and-packaging",
8080
"createdAt": "2026-01-01T00:00:00.000Z",
81-
"status": "open"
81+
"status": "resolved",
82+
"resolvedAt": "2026-01-07T00:00:00.000Z"
8283
},
8384
{
8485
"id": 6,
@@ -91,9 +92,10 @@
9192
"fingerprint": "spec|spec-001|epic|e006-packaging",
9293
"source": "/pro:spec.import",
9394
"sourceSpec": "spec-001",
94-
"sourceBranch": null,
95+
"sourceBranch": "feat/metadata-and-packaging",
9596
"createdAt": "2026-01-01T00:00:00.000Z",
96-
"status": "open"
97+
"status": "resolved",
98+
"resolvedAt": "2026-01-07T00:00:00.000Z"
9799
},
98100
{
99101
"id": 7,
@@ -201,9 +203,10 @@
201203
"fingerprint": "spec|spec-001|story|us006-metadata",
202204
"source": "/pro:spec.import",
203205
"sourceSpec": "spec-001",
204-
"sourceBranch": null,
206+
"sourceBranch": "feat/metadata-and-packaging",
205207
"createdAt": "2026-01-01T00:00:00.000Z",
206-
"status": "open"
208+
"status": "resolved",
209+
"resolvedAt": "2026-01-07T00:00:00.000Z"
207210
}
208211
]
209212
}

0 commit comments

Comments
 (0)