Skip to content

Commit ea8877b

Browse files
authored
Initial commit
0 parents  commit ea8877b

33 files changed

+1554
-0
lines changed

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# Top-most EditorConfig file
4+
root = true
5+
6+
# Global settings (applicable to all files unless overridden)
7+
[*]
8+
charset = utf-8 # Default character encoding
9+
end_of_line = lf # Use LF for line endings (Unix-style)
10+
indent_style = space # Use spaces for indentation
11+
indent_size = 4 # Default indentation size
12+
insert_final_newline = true # Make sure files end with a newline
13+
trim_trailing_whitespace = true # Remove trailing whitespace
14+
15+
# Rust files
16+
[*.rs]
17+
max_line_length = 100
18+
19+
# Markdown files
20+
[*.md]
21+
max_line_length = 120
22+
trim_trailing_whitespace = false # Don't remove trailing whitespace in Markdown files
23+
24+
# Bash scripts
25+
[*.sh]
26+
indent_size = 2
27+
28+
# YAML files
29+
[*.{yaml,yml}]
30+
indent_size = 2
31+

.gitattributes

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Normalize all text files to LF line endings
2+
* text=auto eol=lf
3+
4+
# Go source files
5+
*.go text
6+
*.mod text
7+
*.sum text
8+
9+
# Markdown and documentation files
10+
*.md text
11+
*.rst text
12+
13+
# JSON, YAML, and configuration files
14+
*.json text
15+
*.yaml text
16+
*.yml text
17+
*.toml text
18+
19+
# Shell scripts
20+
*.sh text eol=lf
21+
22+
# Static files
23+
*.html text
24+
*.css text
25+
*.js text
26+
*.svg text
27+
*.xml text
28+
29+
# Large assets (use Git LFS)
30+
*.png filter=lfs diff=lfs merge=lfs -text
31+
*.jpg filter=lfs diff=lfs merge=lfs -text
32+
*.jpeg filter=lfs diff=lfs merge=lfs -text
33+
*.gif filter=lfs diff=lfs merge=lfs -text
34+
*.ico filter=lfs diff=lfs merge=lfs -text
35+
*.mp4 filter=lfs diff=lfs merge=lfs -text
36+
*.mov filter=lfs diff=lfs merge=lfs -text
37+
*.zip filter=lfs diff=lfs merge=lfs -text
38+
*.tar filter=lfs diff=lfs merge=lfs -text
39+
*.gz filter=lfs diff=lfs merge=lfs -text
40+
*.tgz filter=lfs diff=lfs merge=lfs -text
41+
42+
# Font files (binary, tracked via LFS)
43+
*.ttf filter=lfs diff=lfs merge=lfs -text
44+
*.woff filter=lfs diff=lfs merge=lfs -text
45+
*.woff2 filter=lfs diff=lfs merge=lfs -text
46+
47+
# Build artifacts (binary, optional LFS tracking)
48+
*.exe filter=lfs diff=lfs merge=lfs -text
49+
*.dll filter=lfs diff=lfs merge=lfs -text
50+
*.so filter=lfs diff=lfs merge=lfs -text
51+
*.out filter=lfs diff=lfs merge=lfs -text
52+
*.a filter=lfs diff=lfs merge=lfs -text
53+
*.o filter=lfs diff=lfs merge=lfs -text
54+
55+
# Exclude files from language stats (GitHub Linguist)
56+
*.ipynb linguist-vendored

.github/workflows/build_linux.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Linux Build
2+
3+
on:
4+
workflow_dispatch: { } # Allow manual execution
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Rust
15+
uses: actions-rust-lang/setup-rust-toolchain@v1
16+
with:
17+
toolchain: stable
18+
19+
- name: Install Dependencies and Run Tests
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y make
23+
make test
24+
continue-on-error: false
25+
26+
- name: Build for Linux
27+
run: |
28+
make build
29+
continue-on-error: false
30+
31+
- name: List Build Directory (for Debugging)
32+
run: ls -R target
33+
34+
- name: Upload Build Artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: template-rust-project-linux-amd64
38+
path: 'target/release/template-rust-project'

.github/workflows/build_macos.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: MacOS Build
2+
3+
on:
4+
workflow_dispatch: { } # Allow manual execution
5+
6+
jobs:
7+
build:
8+
runs-on: macos-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Rust
15+
uses: actions-rust-lang/setup-rust-toolchain@v1
16+
with:
17+
toolchain: stable
18+
19+
- name: Install Dependencies
20+
run: |
21+
brew install make
22+
make test
23+
continue-on-error: false
24+
25+
- name: Build for MacOS
26+
run: |
27+
make build
28+
continue-on-error: false
29+
30+
- name: List Build Directory (for Debugging)
31+
run: ls -R target
32+
33+
- name: Upload Build Artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: template-rust-project-macos-amd64
37+
path: 'target/release/template-rust-project'

.github/workflows/build_windows.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Windows Build
2+
3+
on:
4+
workflow_dispatch: { } # Allow manual execution
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Rust
15+
uses: actions-rust-lang/setup-rust-toolchain@v1
16+
with:
17+
toolchain: stable
18+
19+
- name: Install Dependencies
20+
run: |
21+
choco install make -y
22+
make test
23+
continue-on-error: false
24+
25+
- name: Build for Windows
26+
run: |
27+
make build
28+
continue-on-error: false
29+
30+
- name: List Build Directory (for Debugging)
31+
run: ls -R target
32+
33+
- name: Upload Build Artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: template-rust-project-windows-amd64
37+
path: 'target/release/template-rust-project.exe'

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run Linters
2+
3+
on:
4+
workflow_dispatch: { } # Allow manual execution
5+
push:
6+
tags:
7+
- 'v*' # Trigger on version tags
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Rust
18+
uses: actions-rust-lang/setup-rust-toolchain@v1
19+
with:
20+
toolchain: stable
21+
22+
- name: Install Dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y clang curl pkg-config libssl-dev make
26+
make install-deps
27+
28+
- name: Run Linters
29+
run: make lint

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to Crates.io
2+
3+
on:
4+
workflow_dispatch: { } # Allow manual execution
5+
push:
6+
tags:
7+
- 'v*' # Trigger on version tags
8+
9+
jobs:
10+
11+
# Run tests before publishing and only publish if tests pass
12+
call_tests:
13+
uses: ./.github/workflows/tests.yml
14+
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
# Try to publish only if the tests pass
19+
needs: call_tests
20+
if: success()
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Rust
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: stable
30+
31+
- name: Publish to Crates.io
32+
env:
33+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y make
37+
cargo publish --token $CARGO_REGISTRY_TOKEN
38+
continue-on-error: false

0 commit comments

Comments
 (0)