Skip to content

Commit 8dbe1db

Browse files
committed
version 1.0.0
0 parents  commit 8dbe1db

13 files changed

Lines changed: 2529 additions & 0 deletions

File tree

.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, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test (${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: dtolnay/rust-toolchain@stable
23+
- uses: Swatinem/rust-cache@v2
24+
- run: cargo test --all-features
25+
26+
msrv:
27+
name: MSRV (1.78.0)
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dtolnay/rust-toolchain@1.78.0
32+
- uses: Swatinem/rust-cache@v2
33+
- run: cargo build --all-features
34+
35+
clippy:
36+
name: Clippy
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/rust-toolchain@stable
41+
with:
42+
components: clippy
43+
- uses: Swatinem/rust-cache@v2
44+
- run: cargo clippy --all-targets --all-features -- -D warnings
45+
46+
fmt:
47+
name: Format
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: dtolnay/rust-toolchain@stable
52+
with:
53+
components: rustfmt
54+
- run: cargo fmt --all --check
55+
56+
audit:
57+
name: Security Audit
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: rustsec/audit-check@v2
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
65+
coverage:
66+
name: Code Coverage
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: dtolnay/rust-toolchain@stable
71+
with:
72+
components: llvm-tools-preview
73+
- uses: Swatinem/rust-cache@v2
74+
- uses: taiki-e/install-action@cargo-llvm-cov
75+
- name: Generate coverage
76+
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
77+
- name: Upload coverage to Codecov
78+
uses: codecov/codecov-action@v4
79+
with:
80+
files: lcov.info
81+
fail_ci_if_error: false
82+
env:
83+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/release.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
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+
- target: x86_64-unknown-linux-gnu
20+
os: ubuntu-latest
21+
archive: tar.gz
22+
- target: x86_64-unknown-linux-musl
23+
os: ubuntu-latest
24+
archive: tar.gz
25+
- target: aarch64-unknown-linux-gnu
26+
os: ubuntu-latest
27+
archive: tar.gz
28+
- target: x86_64-apple-darwin
29+
os: macos-latest
30+
archive: tar.gz
31+
- target: aarch64-apple-darwin
32+
os: macos-latest
33+
archive: tar.gz
34+
- target: x86_64-pc-windows-msvc
35+
os: windows-latest
36+
archive: zip
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: dtolnay/rust-toolchain@stable
42+
with:
43+
targets: ${{ matrix.target }}
44+
45+
- name: Install cross-compilation tools
46+
if: matrix.target == 'aarch64-unknown-linux-gnu'
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y gcc-aarch64-linux-gnu
50+
51+
- name: Install musl tools
52+
if: matrix.target == 'x86_64-unknown-linux-musl'
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install -y musl-tools
56+
57+
- uses: Swatinem/rust-cache@v2
58+
with:
59+
key: ${{ matrix.target }}
60+
61+
- name: Build
62+
run: cargo build --release --target ${{ matrix.target }}
63+
env:
64+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
65+
66+
- name: Get binary name
67+
id: binary
68+
shell: bash
69+
run: |
70+
name=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].targets[] | select(.kind[] == "bin") | .name')
71+
echo "name=$name" >> $GITHUB_OUTPUT
72+
73+
- name: Package (Unix)
74+
if: matrix.archive == 'tar.gz'
75+
run: |
76+
cd target/${{ matrix.target }}/release
77+
tar -czvf ../../../${{ steps.binary.outputs.name }}-${{ matrix.target }}.tar.gz ${{ steps.binary.outputs.name }}
78+
79+
- name: Package (Windows)
80+
if: matrix.archive == 'zip'
81+
shell: pwsh
82+
run: |
83+
cd target/${{ matrix.target }}/release
84+
Compress-Archive -Path ${{ steps.binary.outputs.name }}.exe -DestinationPath ../../../${{ steps.binary.outputs.name }}-${{ matrix.target }}.zip
85+
86+
- name: Upload artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: ${{ steps.binary.outputs.name }}-${{ matrix.target }}
90+
path: ${{ steps.binary.outputs.name }}-${{ matrix.target }}.*
91+
92+
release:
93+
name: Create Release
94+
needs: build
95+
runs-on: ubuntu-latest
96+
permissions:
97+
contents: write
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- name: Download artifacts
102+
uses: actions/download-artifact@v4
103+
with:
104+
path: artifacts
105+
merge-multiple: true
106+
107+
- name: Create release
108+
uses: softprops/action-gh-release@v2
109+
with:
110+
generate_release_notes: true
111+
files: artifacts/*
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Cargo
2+
/target/
3+
4+
# Cargo.lock is included for binaries, excluded for libraries
5+
# Uncomment the next line if this is a library crate
6+
# Cargo.lock
7+
8+
# MSVC Windows builds
9+
*.pdb
10+
11+
# Backup files
12+
*~
13+
*.bak
14+
15+
# IDE/Editor
16+
.idea/
17+
.vscode/
18+
*.swp
19+
*.swo
20+
.DS_Store

0 commit comments

Comments
 (0)