Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .cargo-husky/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
# Pre-commit hook to check code formatting and lints

# Check formatting
cargo fmt --check
if [ $? -ne 0 ]; then
echo ""
echo "❌ Code is not formatted. Run 'cargo fmt' to fix."
echo ""
exit 1
fi

# Run clippy
cargo clippy --all-targets --all-features -- -D warnings
if [ $? -ne 0 ]; then
echo ""
echo "❌ Clippy found issues. Fix the warnings above."
echo ""
exit 1
fi

exit 0
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target = "i686-pc-windows-msvc"
[build]
target = "i686-pc-windows-msvc"
78 changes: 39 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: i686-pc-windows-msvc
components: rustfmt, clippy

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Build
run: cargo build --release --target i686-pc-windows-msvc

- name: Check formatting
run: cargo fmt --check

- name: Clippy
run: cargo clippy --target i686-pc-windows-msvc -- -D warnings

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: i686-pc-windows-msvc
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
run: cargo build --release --target i686-pc-windows-msvc
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --target i686-pc-windows-msvc -- -D warnings
130 changes: 65 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
name: Release

on:
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate tag
id: tag
run: |
$date = Get-Date -Format "yyyy.MM.dd"
$baseTag = "v$date"
$counter = 0
$tag = $baseTag

while (git tag -l $tag) {
$counter++
$tag = "$baseTag.$counter"
}

echo "tag=$tag" >> $env:GITHUB_OUTPUT
echo "Generated tag: $tag"

- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.tag.outputs.tag }}
git push origin ${{ steps.tag.outputs.tag }}

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: i686-pc-windows-msvc

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Build
run: cargo build --release --target i686-pc-windows-msvc

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
files: target/i686-pc-windows-msvc/release/systemdetection.dll
generate_release_notes: true

name: Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate tag
id: tag
run: |
$date = Get-Date -Format "yyyy.MM.dd"
$baseTag = "v$date"
$counter = 0
$tag = $baseTag
while (git tag -l $tag) {
$counter++
$tag = "$baseTag.$counter"
}
echo "tag=$tag" >> $env:GITHUB_OUTPUT
echo "Generated tag: $tag"
- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.tag.outputs.tag }}
git push origin ${{ steps.tag.outputs.tag }}
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: i686-pc-windows-msvc
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
run: cargo build --release --target i686-pc-windows-msvc
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
files: target/i686-pc-windows-msvc/release/systemdetection.dll
generate_release_notes: true
46 changes: 23 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Build outputs
**/target/

# Built DLLs (generated artifacts)
*.dll
*.pdb
*.exp
*.lib

# IDA Pro files
*.i64
*.id0
*.id1
*.id2
*.nam
*.til

# VS Code
.vscode/

# OS files
Thumbs.db
.DS_Store
# Build outputs
**/target/
# Built DLLs (generated artifacts)
*.dll
*.pdb
*.exp
*.lib
# IDA Pro files
*.i64
*.id0
*.id1
*.id2
*.nam
*.til
# VS Code
.vscode/
# OS files
Thumbs.db
.DS_Store
Loading