Skip to content

Commit 846a4c4

Browse files
init 0.1.0
0 parents  commit 846a4c4

33 files changed

Lines changed: 7710 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
- uses: Swatinem/rust-cache@v2
22+
23+
- name: Build
24+
run: cargo build --verbose
25+
26+
- name: Run tests
27+
run: cargo test --verbose
28+
29+
clippy:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: dtolnay/rust-toolchain@stable
34+
with:
35+
components: clippy
36+
- uses: Swatinem/rust-cache@v2
37+
- name: Clippy
38+
run: cargo clippy -- -D warnings
39+
40+
fmt:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: dtolnay/rust-toolchain@stable
45+
with:
46+
components: rustfmt
47+
- name: Check formatting
48+
run: cargo fmt --check

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
include:
15+
- target: x86_64-unknown-linux-gnu
16+
os: ubuntu-latest
17+
archive: tar.gz
18+
- target: aarch64-unknown-linux-gnu
19+
os: ubuntu-latest
20+
archive: tar.gz
21+
- target: x86_64-apple-darwin
22+
os: macos-latest
23+
archive: tar.gz
24+
- target: aarch64-apple-darwin
25+
os: macos-latest
26+
archive: tar.gz
27+
- target: x86_64-pc-windows-msvc
28+
os: windows-latest
29+
archive: zip
30+
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dtolnay/rust-toolchain@stable
35+
with:
36+
targets: ${{ matrix.target }}
37+
38+
- name: Install cross-compilation tools (aarch64-linux)
39+
if: matrix.target == 'aarch64-unknown-linux-gnu'
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y gcc-aarch64-linux-gnu
43+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
44+
45+
- name: Build
46+
run: cargo build --release --target ${{ matrix.target }}
47+
48+
- name: Package (unix)
49+
if: matrix.archive == 'tar.gz'
50+
run: |
51+
cd target/${{ matrix.target }}/release
52+
tar czf ../../../ppt-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ppt
53+
cd ../../..
54+
55+
- name: Package (windows)
56+
if: matrix.archive == 'zip'
57+
shell: pwsh
58+
run: |
59+
Compress-Archive -Path "target/${{ matrix.target }}/release/ppt.exe" -DestinationPath "ppt-${{ github.ref_name }}-${{ matrix.target }}.zip"
60+
61+
- name: Upload artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: ppt-${{ matrix.target }}
65+
path: ppt-${{ github.ref_name }}-${{ matrix.target }}.*
66+
67+
release:
68+
needs: build
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/download-artifact@v4
72+
with:
73+
merge-multiple: true
74+
75+
- name: Create GitHub Release
76+
uses: softprops/action-gh-release@v2
77+
with:
78+
generate_release_notes: true
79+
files: ppt-*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/keys

0 commit comments

Comments
 (0)