Skip to content

Commit 2dd79d5

Browse files
committed
feat: v1.0.0
0 parents  commit 2dd79d5

File tree

22 files changed

+3460
-0
lines changed

22 files changed

+3460
-0
lines changed

.dockerignore

Whitespace-only changes.

.github/workflows/release.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
target:
15+
- x86_64-unknown-linux-musl
16+
- aarch64-unknown-linux-musl
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust target
23+
run: rustup target add ${{ matrix.target }}
24+
25+
- name: Install musl tools and cross-compiler
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu
29+
30+
- name: Configure linker (only for aarch64)
31+
if: matrix.target == 'aarch64-unknown-linux-musl'
32+
run: |
33+
mkdir -p ~/.cargo
34+
echo '[target.aarch64-unknown-linux-musl]' >> ~/.cargo/config.toml
35+
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
36+
37+
- name: Run Tests
38+
if: matrix.target == 'x86_64-unknown-linux-musl'
39+
run: RUST_TEST_THREADS=1 cargo test --target=${{ matrix.target }}
40+
41+
- name: Build release binary
42+
run: cargo build --release --target=${{ matrix.target }} --locked
43+
44+
- name: Package as tar.gz
45+
run: |
46+
mkdir -p dist
47+
BIN=target/${{ matrix.target }}/release/trailerfin_rust
48+
if [ ! -f "$BIN" ]; then
49+
echo "❌ Binary not found: $BIN"
50+
exit 1
51+
fi
52+
cp "$BIN" dist/
53+
cd dist
54+
chmod +x ./trailerfin_rust
55+
tar -czf trailerfin_rust-${{ matrix.target }}.tar.gz trailerfin_rust
56+
cd ..
57+
58+
- uses: actions/upload-artifact@v4
59+
with:
60+
name: trailerfin_rust-${{ matrix.target }}
61+
path: dist/trailerfin_rust-${{ matrix.target }}.tar.gz
62+
63+
upload-release:
64+
needs: build
65+
runs-on: ubuntu-latest
66+
if: startsWith(github.ref, 'refs/tags/')
67+
steps:
68+
- uses: actions/download-artifact@v4
69+
with:
70+
path: dist
71+
72+
- name: Flatten artifacts
73+
run: |
74+
mkdir -p upload
75+
find dist -name '*.tar.gz' -exec mv {} upload/ \;
76+
77+
- name: Upload to GitHub Release
78+
uses: softprops/action-gh-release@v2
79+
with:
80+
files: upload/*.tar.gz
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
/data
3+
4+
.DS_Store
5+
6+
.idea/

0 commit comments

Comments
 (0)