diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b2034b0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - run: cargo fmt --all -- --check + - run: cargo clippy --workspace -- -D warnings + - name: Run tests + run: cargo test --workspace 2>&1 | tee test-output.txt + - run: cargo doc --no-deps -p wavekat-core --all-features + - name: Job summary + if: always() + run: | + echo "## Check" >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + rustc --version >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + if [ -f test-output.txt ]; then + echo "### Test Results" >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + grep -E '^test result:|^running' test-output.txt >> "$GITHUB_STEP_SUMMARY" || true + echo '```' >> "$GITHUB_STEP_SUMMARY" + fi diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..913a994 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,56 @@ +name: Release-plz + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + release-plz-release: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + release-plz-pr: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: release-plz/action@v0.5 + id: release-plz + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Job summary + if: always() + run: | + echo "## Release PR" >> "$GITHUB_STEP_SUMMARY" + if [ "${{ steps.release-plz.outputs.prs_created }}" = "true" ]; then + echo "Release PR created." >> "$GITHUB_STEP_SUMMARY" + else + echo "No release PR created." >> "$GITHUB_STEP_SUMMARY" + fi diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..97acacc --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,12 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +title: wavekat-core +abstract: Shared types for the WaveKat audio processing ecosystem. +type: software +authors: + - given-names: Yishi + family-names: Guo + alias: Eason + email: eason@wavekat.com +repository-code: https://github.com/wavekat/wavekat-core +license: Apache-2.0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..479dcff --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +.PHONY: help check test fmt lint doc ci + +help: + @echo "Available targets:" + @echo " check Check workspace compiles" + @echo " test Run all tests" + @echo " fmt Format code" + @echo " lint Run clippy with warnings as errors" + @echo " doc Build and open docs in browser" + @echo " ci Run all CI checks locally (fmt, clippy, test, doc)" + +# Check workspace compiles +check: + cargo check --workspace + +# Run all tests +test: + cargo test --workspace + +# Format code +fmt: + cargo fmt --all + +# Lint +lint: + cargo clippy --workspace -- -D warnings + +# Build and open docs in browser +doc: + cargo doc --no-deps -p wavekat-core --all-features --open + +# Run all CI checks locally (mirrors .github/workflows/ci.yml) +ci: + cargo fmt --all -- --check + cargo clippy --workspace -- -D warnings + cargo test --workspace + cargo doc --no-deps -p wavekat-core --all-features diff --git a/crates/wavekat-core/Cargo.toml b/crates/wavekat-core/Cargo.toml index 14a71b6..38cc9aa 100644 --- a/crates/wavekat-core/Cargo.toml +++ b/crates/wavekat-core/Cargo.toml @@ -4,6 +4,10 @@ description = "Shared types for the WaveKat audio processing ecosystem" version.workspace = true edition.workspace = true license.workspace = true +repository = "https://github.com/wavekat/wavekat-core" +homepage = "https://github.com/wavekat/wavekat-core" +documentation = "https://docs.rs/wavekat-core" +readme = "../../README.md" keywords = ["audio", "voice", "telephony", "wavekat"] categories = ["multimedia::audio"] diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..68387a3 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,3 @@ +[workspace] +git_tag_enable = true +git_release_enable = true