Skip to content

Commit 1ac66bc

Browse files
committed
new start
1 parent 9dce947 commit 1ac66bc

16 files changed

Lines changed: 3414 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
rust: [stable, beta, nightly]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
components: rustfmt, clippy
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v3
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
35+
- name: Cache cargo index
36+
uses: actions/cache@v3
37+
with:
38+
path: ~/.cargo/git
39+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Cache cargo build
42+
uses: actions/cache@v3
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
46+
47+
- name: Check formatting
48+
run: cargo fmt -- --check
49+
50+
- name: Run clippy
51+
run: cargo clippy -- -D warnings
52+
53+
- name: Run tests
54+
run: cargo test --verbose
55+
56+
coverage:
57+
name: Coverage
58+
runs-on: ubuntu-latest
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Install Rust
64+
uses: dtolnay/rust-toolchain@stable
65+
66+
- name: Install tarpaulin
67+
run: cargo install cargo-tarpaulin
68+
69+
- name: Generate coverage report
70+
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
71+
72+
- name: Upload to codecov.io
73+
uses: codecov/codecov-action@v3
74+
with:
75+
fail_ci_if_error: true
76+
77+
security:
78+
name: Security audit
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Install Rust
85+
uses: dtolnay/rust-toolchain@stable
86+
87+
- name: Install cargo-audit
88+
run: cargo install cargo-audit
89+
90+
- name: Run security audit
91+
run: cargo audit
92+
93+
build:
94+
name: Build
95+
runs-on: ${{ matrix.os }}
96+
strategy:
97+
matrix:
98+
os: [ubuntu-latest, windows-latest, macos-latest]
99+
100+
steps:
101+
- uses: actions/checkout@v4
102+
103+
- name: Install Rust
104+
uses: dtolnay/rust-toolchain@stable
105+
106+
- name: Build
107+
run: cargo build --release --verbose
108+
109+
- name: Upload artifacts
110+
uses: actions/upload-artifact@v3
111+
with:
112+
name: rust-yt-upload-${{ matrix.os }}
113+
path: |
114+
target/release/rust-yt-upload*
115+
!target/release/rust-yt-upload.d

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Rust
2+
/target/
3+
Cargo.lock
4+
**/*.rs.bk
5+
*.pdb
6+
7+
# IDE
8+
.vscode/
9+
.idea/
10+
*.swp
11+
*.swo
12+
*~
13+
14+
# OS
15+
.DS_Store
16+
.DS_Store?
17+
._*
18+
.Spotlight-V100
19+
.Trashes
20+
ehthumbs.db
21+
Thumbs.db
22+
23+
# Logs
24+
*.log
25+
26+
# OAuth credentials and tokens (NEVER commit these)
27+
client_secret.json
28+
*-oauth2.json
29+
youtube-oauth2.json
30+
31+
# Test files
32+
test_videos/
33+
*.mp4
34+
*.avi
35+
*.mov
36+
*.mkv
37+
*.mts
38+
39+
# Coverage reports
40+
coverage/
41+
tarpaulin-report.html
42+
43+
# Documentation build
44+
/docs/
45+
46+
# Environment variables
47+
.env
48+
.env.local
49+
50+
# Temporary files
51+
*.tmp
52+
*.temp

Cargo.toml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[package]
2+
name = "rust-yt-uploader"
3+
version = "0.2.0"
4+
edition = "2021"
5+
authors = ["YouTube Uploader Team"]
6+
description = "High-performance YouTube video uploader in Rust with OAuth 2.0, concurrent uploads, and comprehensive validation"
7+
license = "MIT"
8+
repository = "https://github.com/yourusername/rust-yt-uploader"
9+
keywords = ["youtube", "upload", "api", "oauth", "async"]
10+
categories = ["api-bindings", "multimedia::video", "authentication"]
11+
exclude = ["client_secret.json", "youtube-oauth2.json", "example-config.yaml"]
12+
13+
[lib]
14+
name = "rust_yt_uploader"
15+
16+
[[bin]]
17+
name = "yt-upload"
18+
path = "src/bin/yt_upload.rs"
19+
20+
[features]
21+
# default = []
22+
default = ["use-yup-oauth2"]
23+
use-yup-oauth2 = ["yup-oauth2"]
24+
25+
[dependencies]
26+
# Async runtime
27+
tokio = { version = "1.49.0", features = ["full"] }
28+
29+
# HTTP client and Google Cloud SDK
30+
reqwest = { version = "0.13.1", features = [
31+
"json",
32+
"multipart",
33+
"stream",
34+
"form",
35+
] }
36+
yup-oauth2 = { version = "12.1.2", optional = true }
37+
38+
# CLI
39+
clap = { version = "4.5.54", features = ["derive"] }
40+
41+
# Serialization
42+
serde = { version = "1.0.228", features = ["derive"] }
43+
serde_yaml_ng = "0.10.0"
44+
serde_json = "1.0.149"
45+
46+
# Error handling
47+
anyhow = "1.0.100"
48+
49+
# Logging
50+
tracing = "0.1.44"
51+
tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }
52+
53+
# Validation
54+
validator = { version = "0.20.0", features = ["derive"] }
55+
regex = "1.12.2"
56+
57+
# Utilities
58+
rand = "0.9.2"
59+
futures = "0.3.31"
60+
url = "2.5.8"
61+
shellexpand = "3.1.1"
62+
sha2 = "0.10.9"
63+
base64 = "0.22.1"
64+
urlencoding = "2.1.3"
65+
open = "5.3.3"
66+
tiny_http = "0.12.0"
67+
68+
# File handling
69+
mime = "0.3.17"
70+
mime_guess = "2.0.5"
71+
serde-jsonlines = "0.7.0"
72+
tokio-util = { version = "0.7.10", features = ["io"] }
73+
74+
# Progress bars
75+
indicatif = "0.17.11"
76+
77+
[dev-dependencies]
78+
tempfile = "3.24.0"

0 commit comments

Comments
 (0)