Skip to content

Commit f31119c

Browse files
committed
docs: update README with usage instructions
- Add installation instructions for all platforms - Document YAML configuration format - Explain CLI options and output - Add usage examples
1 parent bd98a81 commit f31119c

File tree

20 files changed

+2295
-141
lines changed

20 files changed

+2295
-141
lines changed

.github/workflows/ci.yml

Lines changed: 163 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,180 @@
1-
name: CI
1+
name: CI & Release
22

33
on:
44
push:
5-
branches: [main, develop]
5+
branches: [main]
66
pull_request:
7-
branches: [main, develop]
7+
branches: [main]
8+
9+
env:
10+
RUST_VERSION: stable
11+
CARGO_TERM_COLOR: always
812

913
jobs:
14+
# ═══════════════════════════════════════════════════════════════════════════════
15+
# LINT
16+
# ═══════════════════════════════════════════════════════════════════════════════
17+
fmt:
18+
name: Format
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: dtolnay/rust-toolchain@stable
23+
with:
24+
components: rustfmt
25+
- name: Check formatting
26+
run: cargo fmt --all -- --check
27+
28+
clippy:
29+
name: Clippy
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: dtolnay/rust-toolchain@stable
34+
with:
35+
components: clippy
36+
- name: Run clippy
37+
run: cargo clippy --all-targets --all-features -- -D warnings
38+
39+
# ═══════════════════════════════════════════════════════════════════════════════
40+
# TEST
41+
# ═══════════════════════════════════════════════════════════════════════════════
1042
test:
43+
name: Test
1144
runs-on: ubuntu-latest
1245
steps:
1346
- uses: actions/checkout@v4
14-
- name: Setup Rust
15-
uses: dtolnay/rust-toolchain@stable
47+
- uses: dtolnay/rust-toolchain@stable
1648
- name: Run tests
17-
run: cargo test
49+
run: cargo test --all-features
1850

19-
build:
51+
security:
52+
name: Security
2053
runs-on: ubuntu-latest
2154
steps:
2255
- uses: actions/checkout@v4
56+
- name: Run security audit
57+
uses: rustsec/audit-check@v2.0.0
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
# ═══════════════════════════════════════════════════════════════════════════════
62+
# BUILD
63+
# ═══════════════════════════════════════════════════════════════════════════════
64+
build:
65+
name: Build (${{ matrix.target }})
66+
needs: [fmt, clippy, test, security]
67+
runs-on: ${{ matrix.os }}
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
include:
72+
- os: ubuntu-latest
73+
target: x86_64-unknown-linux-gnu
74+
binary: git-reports
75+
ext: ''
76+
- os: ubuntu-latest
77+
target: aarch64-unknown-linux-gnu
78+
binary: git-reports
79+
ext: ''
80+
- os: macos-latest
81+
target: x86_64-apple-darwin
82+
binary: git-reports
83+
ext: ''
84+
- os: windows-latest
85+
target: x86_64-pc-windows-msvc
86+
binary: git-reports.exe
87+
ext: .exe
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
2392
- name: Setup Rust
2493
uses: dtolnay/rust-toolchain@stable
25-
- name: Build
26-
run: cargo build --release
94+
with:
95+
targets: ${{ matrix.target }}
96+
97+
- name: Build release
98+
run: cargo build --release --locked
99+
100+
- name: Create package
101+
run: |
102+
mkdir -p release
103+
cp target/release/${{ matrix.binary }} release/${{ matrix.binary }}
104+
105+
- name: Upload artifact
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: ${{ matrix.binary }}-${{ matrix.target }}
109+
path: release/${{ matrix.binary }}
110+
retention-days: 5
111+
112+
# ═══════════════════════════════════════════════════════════════════════════════
113+
# RELEASE
114+
# ═══════════════════════════════════════════════════════════════════════════════
115+
release:
116+
name: Release
117+
needs: build
118+
runs-on: ubuntu-latest
119+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
120+
121+
steps:
122+
- name: Download all artifacts
123+
uses: actions/download-artifact@v4
124+
with:
125+
path: artifacts
126+
pattern: '*'
127+
merge-multiple: true
128+
129+
- name: Generate checksum
130+
run: |
131+
cd artifacts
132+
sha256sum * > SHA256SUMS.txt
133+
cat SHA256SUMS.txt
134+
135+
- name: Determine version
136+
id: version
137+
run: |
138+
VERSION="v1.0.$(date +%Y%m%d%H%M%S)"
139+
echo "version=$VERSION" >> $GITHUB_OUTPUT
140+
echo "Creating release: $VERSION"
141+
142+
- name: Create Release
143+
uses: softprops/action-gh-release@v2
144+
with:
145+
name: ${{ steps.version.outputs.version }}
146+
draft: false
147+
prerelease: false
148+
generate_release_notes: true
149+
files: |
150+
artifacts/*
151+
body: |
152+
## 📦 Executables
153+
154+
Download the executable for your platform:
155+
156+
| Platform | File |
157+
|----------|------|
158+
| Linux x64 | `git-reports-x86_64-unknown-linux-gnu` |
159+
| Linux ARM64 | `git-reports-aarch64-unknown-linux-gnu` |
160+
| macOS x64 | `git-reports-x86_64-apple-darwin` |
161+
| Windows x64 | `git-reports.exe` |
162+
163+
## 🔒 Checksums
164+
165+
Verify the integrity of your download:
166+
167+
```
168+
$(cat artifacts/SHA256SUMS.txt)
169+
```
170+
171+
## 🚀 Usage
172+
173+
```bash
174+
# Create config.yaml in the same directory as the executable
175+
./git-reports
176+
```
177+
178+
See [README](https://github.com/madkoding/git-reports#readme) for configuration.
179+
env:
180+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ Cargo.lock
66
.DS_Store
77

88
# Configuración local con tokens (no subir al repo)
9+
config.yaml
910
config.toml
11+
reporte.md
12+
reports/

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ clap = { version = "4.4", features = ["derive"] }
1212
chrono = { version = "0.4", features = ["serde"] }
1313
serde = { version = "1.0", features = ["derive"] }
1414
serde_json = "1.0"
15-
toml = "0.8"
15+
serde_yaml = "0.9"
1616
dirs-next = "2.0"
1717
reqwest = { version = "0.12", features = ["json", "blocking"] }
1818
git2 = "0.20"
1919
tokio = { version = "1", features = ["full"] }
2020

21+
[dev-dependencies]
22+
tempfile = "3.8"
23+
2124
[lib]
2225
name = "git_reports"
23-
path = "src/lib.rs"
26+
path = "src/core/mod.rs"
2427

2528
[[bin]]
2629
name = "git-reports"
27-
path = "src/main.rs"
30+
path = "src/cli/main.rs"

0 commit comments

Comments
 (0)