Skip to content

Commit 9ff5205

Browse files
committed
feat!: add docs and improve project organization
Signed-off-by: Rubens <[email protected]>
1 parent 809af53 commit 9ff5205

30 files changed

+3684
-914
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## System Information
14+
15+
- **OS**: [e.g., Ubuntu 22.04, macOS 14.0, Windows 11]
16+
- **Architecture**: [e.g., x86_64, aarch64]
17+
- **Zig Version**: [output of `zig version`]
18+
- **zfetch Version**: [output of `zfetch --version`]
19+
20+
## Steps to Reproduce
21+
22+
1. Run '...'
23+
2. See error
24+
25+
## Expected Behavior
26+
27+
A clear and concise description of what you expected to happen.
28+
29+
## Actual Behavior
30+
31+
What actually happened.
32+
33+
## Output
34+
35+
```
36+
Paste the output here
37+
```
38+
39+
## Additional Context
40+
41+
Add any other context about the problem here.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like.
12+
13+
## Use Case
14+
15+
Why would this feature be useful? What problem does it solve?
16+
17+
## Proposed Solution
18+
19+
How do you envision this feature working?
20+
21+
## Alternatives Considered
22+
23+
Have you considered any alternative solutions or workarounds?
24+
25+
## Platform
26+
27+
Which platform(s) would this feature apply to?
28+
29+
- [ ] Linux
30+
- [ ] macOS
31+
- [ ] Windows
32+
- [ ] All platforms
33+
34+
## Additional Context
35+
36+
Add any other context, screenshots, or examples about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Description
2+
3+
Brief description of the changes in this PR.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change that fixes an issue)
8+
- [ ] New feature (non-breaking change that adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Refactoring (no functional changes)
12+
13+
## Related Issues
14+
15+
Closes #(issue number)
16+
17+
## Changes Made
18+
19+
- Change 1
20+
- Change 2
21+
- ...
22+
23+
## Testing
24+
25+
Describe the tests you ran to verify your changes:
26+
27+
- [ ] `zig build` completes without errors
28+
- [ ] `zig build test` passes
29+
- [ ] `zig build run` works correctly
30+
- [ ] Tested on: [OS/platform]
31+
32+
## Checklist
33+
34+
- [ ] My code follows the project's style guidelines
35+
- [ ] I have performed a self-review of my code
36+
- [ ] I have commented my code, particularly in hard-to-understand areas
37+
- [ ] I have made corresponding changes to the documentation
38+
- [ ] My changes generate no new warnings
39+
- [ ] I have added tests that prove my fix is effective or that my feature works
40+
- [ ] New and existing tests pass locally with my changes
41+
42+
## Screenshots (if applicable)
43+
44+
Add screenshots to help explain your changes.
45+
46+
## Additional Notes
47+
48+
Any additional information that reviewers should know.

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build (${{ matrix.os }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Zig
23+
uses: mlugg/setup-zig@v1
24+
with:
25+
version: 0.14.0
26+
27+
- name: Build (Debug)
28+
run: zig build
29+
30+
- name: Run Tests
31+
run: zig build test
32+
33+
- name: Build (Release)
34+
run: zig build -Doptimize=ReleaseFast
35+
36+
- name: Run Application
37+
run: zig build run -- --version
38+
39+
cross-compile:
40+
name: Cross-compile
41+
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
target:
46+
- x86_64-linux
47+
- aarch64-linux
48+
- x86_64-macos
49+
- aarch64-macos
50+
- x86_64-windows
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Zig
57+
uses: mlugg/setup-zig@v1
58+
with:
59+
version: 0.14.0
60+
61+
- name: Cross-compile for ${{ matrix.target }}
62+
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=ReleaseFast
63+
64+
- name: Upload artifact
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: zfetch-${{ matrix.target }}
68+
path: zig-out/bin/zfetch*
69+
70+
lint:
71+
name: Lint
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Setup Zig
78+
uses: mlugg/setup-zig@v1
79+
with:
80+
version: 0.14.0
81+
82+
- name: Check formatting
83+
run: zig fmt --check src/

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Pages
28+
uses: actions/configure-pages@v4
29+
30+
- name: Build with Jekyll
31+
uses: actions/jekyll-build-pages@v1
32+
with:
33+
source: ./docs
34+
destination: ./_site
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
39+
deploy:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
needs: build
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
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: ubuntu-latest
20+
target: x86_64-linux
21+
artifact: zfetch-x86_64-linux
22+
- os: ubuntu-latest
23+
target: aarch64-linux
24+
artifact: zfetch-aarch64-linux
25+
- os: macos-latest
26+
target: x86_64-macos
27+
artifact: zfetch-x86_64-macos
28+
- os: macos-latest
29+
target: aarch64-macos
30+
artifact: zfetch-aarch64-macos
31+
- os: windows-latest
32+
target: x86_64-windows
33+
artifact: zfetch-x86_64-windows
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Zig
40+
uses: mlugg/setup-zig@v1
41+
with:
42+
version: 0.14.0
43+
44+
- name: Build
45+
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=ReleaseFast
46+
47+
- name: Create archive (Unix)
48+
if: runner.os != 'Windows'
49+
run: |
50+
cd zig-out/bin
51+
tar -czvf ../../${{ matrix.artifact }}.tar.gz zfetch*
52+
53+
- name: Create archive (Windows)
54+
if: runner.os == 'Windows'
55+
run: |
56+
cd zig-out/bin
57+
Compress-Archive -Path zfetch* -DestinationPath ../../${{ matrix.artifact }}.zip
58+
59+
- name: Upload artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: ${{ matrix.artifact }}
63+
path: |
64+
${{ matrix.artifact }}.tar.gz
65+
${{ matrix.artifact }}.zip
66+
67+
release:
68+
name: Create Release
69+
needs: build
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Download all artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
path: artifacts
79+
80+
- name: List artifacts
81+
run: find artifacts -type f
82+
83+
- name: Create Release
84+
uses: softprops/action-gh-release@v1
85+
with:
86+
generate_release_notes: true
87+
files: |
88+
artifacts/**/*.tar.gz
89+
artifacts/**/*.zip
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
# Zig build artifacts
12
.zig-cache/
23
zig-out/
4+
5+
# Editor files
6+
*.swp
7+
*.swo
8+
*~
9+
.vscode/
10+
.idea/
11+
12+
# macOS
13+
.DS_Store
14+
15+
# Jekyll (docs)
16+
docs/_site/
17+
docs/.jekyll-cache/
18+
docs/.jekyll-metadata

0 commit comments

Comments
 (0)