Skip to content

Commit ef1f34e

Browse files
committed
Initial release v1.5.5
0 parents  commit ef1f34e

34 files changed

Lines changed: 7333 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: tests + clippy + fmt
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
rust: ['1.88.0', 'stable', 'beta']
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@master
20+
with:
21+
toolchain: ${{ matrix.rust }}
22+
components: rustfmt, clippy
23+
- uses: Swatinem/rust-cache@v2
24+
- name: rustfmt
25+
if: matrix.rust == 'stable'
26+
run: cargo fmt --check
27+
- name: clippy
28+
if: matrix.rust == 'stable'
29+
run: cargo clippy --all-targets -- -D warnings
30+
- name: cargo build
31+
run: cargo build
32+
- name: cargo test
33+
run: cargo test --all-features --no-fail-fast
34+
- name: cargo doc
35+
if: matrix.rust == 'stable'
36+
run: cargo doc --no-deps --all-features
37+
env:
38+
RUSTDOCFLAGS: -D warnings

.github/workflows/contract.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Contract tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 6 * * *' # daily at 06:00 UTC
10+
repository_dispatch:
11+
types: [openapi-updated]
12+
13+
jobs:
14+
contract:
15+
name: validate parser against latest audd-openapi fixtures
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
path: audd-rust
21+
- name: Check out audd-openapi
22+
uses: actions/checkout@v4
23+
with:
24+
repository: AudDMusic/audd-openapi
25+
path: audd-openapi
26+
ref: main
27+
- uses: dtolnay/rust-toolchain@stable
28+
- uses: Swatinem/rust-cache@v2
29+
with:
30+
workspaces: audd-rust
31+
- name: Run contract tests
32+
working-directory: audd-rust
33+
env:
34+
AUDD_OPENAPI_FIXTURES: ${{ github.workspace }}/audd-openapi/fixtures
35+
run: cargo test --test contract -- --nocapture
36+
- name: Open issue on failure (dispatched runs only)
37+
if: failure() && github.event_name == 'repository_dispatch'
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
TRIGGER_SHA: ${{ github.event.client_payload.trigger_sha }}
41+
run: |
42+
gh issue create \
43+
--title "Contract drift: audd-openapi spec change broke parser" \
44+
--body "An openapi-updated dispatch (trigger SHA: $TRIGGER_SHA) caused contract tests to fail. Investigate and update parsers." \
45+
--label "contract-drift" || true

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'audd-rust/v*'
7+
- 'v*'
8+
permissions:
9+
contents: read
10+
id-token: write
11+
attestations: write
12+
13+
jobs:
14+
publish:
15+
name: cargo publish
16+
runs-on: ubuntu-latest
17+
environment: crates-io
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
- uses: Swatinem/rust-cache@v2
22+
- name: Verify the crate builds
23+
run: cargo build --release
24+
- name: cargo package (sanity)
25+
run: cargo package --no-verify
26+
- name: Generate Sigstore attestations
27+
uses: actions/attest-build-provenance@v1
28+
with:
29+
subject-path: 'target/package/audd-*.crate'
30+
- name: Authenticate with crates.io (trusted publishing)
31+
id: auth
32+
uses: rust-lang/crates-io-auth-action@v1
33+
- name: cargo publish
34+
run: cargo publish
35+
env:
36+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
/Cargo.lock
3+
**/*.rs.bk
4+
.DS_Store

Cargo.toml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[package]
2+
name = "audd"
3+
version = "1.5.5"
4+
edition = "2021"
5+
rust-version = "1.88"
6+
license = "MIT"
7+
description = "Official Rust SDK for the AudD music recognition API"
8+
repository = "https://github.com/AudDMusic/audd-rust"
9+
homepage = "https://audd.io"
10+
documentation = "https://docs.rs/audd"
11+
keywords = ["audd", "music", "recognition", "audio", "fingerprint"]
12+
categories = ["api-bindings", "multimedia::audio"]
13+
readme = "README.md"
14+
exclude = ["tests/integration*", ".github/*"]
15+
16+
[features]
17+
# `rustls-tls` is the default and matches the v0.2 behavior (Mozilla CA bundle,
18+
# pure-Rust TLS stack). Opt out with `default-features = false` and enable
19+
# `native-tls` (or `vendored-openssl`) when you need OpenSSL — corp environments
20+
# with custom CA trust stores, OpenSSL FIPS, etc.
21+
default = ["rustls-tls"]
22+
rustls-tls = ["reqwest/rustls-tls"]
23+
native-tls = ["reqwest/native-tls"]
24+
# Statically links a vendored copy of OpenSSL — useful when the build host
25+
# lacks `libssl-dev` / pkg-config OpenSSL headers but you still need the
26+
# OpenSSL TLS stack at runtime.
27+
vendored-openssl = ["reqwest/native-tls", "reqwest/native-tls-vendored"]
28+
# Opt-in live-API integration tests; gate via env var AUDD_API_TOKEN.
29+
integration = []
30+
31+
[dependencies]
32+
reqwest = { version = "0.12", default-features = false, features = ["multipart", "json", "stream"] }
33+
serde = { version = "1", features = ["derive"] }
34+
serde_json = "1"
35+
tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "io-util", "sync", "time"] }
36+
thiserror = "1"
37+
tracing = "0.1"
38+
futures-core = "0.3"
39+
async-stream = "0.3"
40+
tokio-util = { version = "0.7", features = ["io"] }
41+
md5 = "0.7"
42+
url = "2"
43+
44+
[dev-dependencies]
45+
tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "io-util", "sync", "time", "test-util", "signal"] }
46+
tokio-test = "0.4"
47+
wiremock = "0.6"
48+
serde_json = "1"
49+
tempfile = "3"
50+
futures-util = "0.3"
51+
# Used by the `scan_and_rename` example.
52+
clap = { version = "4", features = ["derive"] }
53+
walkdir = "2"
54+
lofty = "0.22"
55+
# Used by the `stream_to_csv` example.
56+
csv = "1"
57+
chrono = { version = "0.4", default-features = false, features = ["clock"] }
58+
59+
[[example]]
60+
name = "recognize_url"
61+
path = "examples/recognize_url.rs"
62+
63+
[[example]]
64+
name = "recognize_file"
65+
path = "examples/recognize_file.rs"
66+
67+
[[example]]
68+
name = "recognize_enterprise"
69+
path = "examples/recognize_enterprise.rs"
70+
71+
[[example]]
72+
name = "streams_setup"
73+
path = "examples/streams_setup.rs"
74+
75+
[[example]]
76+
name = "streams_longpoll"
77+
path = "examples/streams_longpoll.rs"
78+
79+
[[example]]
80+
name = "streams_callback_handler"
81+
path = "examples/streams_callback_handler.rs"
82+
83+
[[example]]
84+
name = "custom_catalog_add"
85+
path = "examples/custom_catalog_add.rs"
86+
87+
[[example]]
88+
name = "tokenless_longpoll"
89+
path = "examples/tokenless_longpoll.rs"
90+
91+
[[example]]
92+
name = "scan_and_rename"
93+
path = "examples/scan_and_rename.rs"
94+
95+
[[example]]
96+
name = "stream_to_csv"
97+
path = "examples/stream_to_csv.rs"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 AudD, LLC (https://audd.io)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)