Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1627409
build(rust): crate skeleton, data codegen, JSON layer and the fixture…
4matic Nov 11, 2026
2ce774b
build(rust): rustfmt config (100 columns) and the skeleton formatted …
4matic Nov 11, 2026
425d48c
feat(rust): single-track parser, R0–R12 (parse, parse_artists, format…
4matic Nov 11, 2026
7af046f
test(rust): typed API tests and the dump example for the cross-port diff
4matic Nov 11, 2026
0d9f6a3
ci(rust): workflow for the crate, and compare-ports with a Rust column
4matic Nov 11, 2026
816366c
feat(rust): tracklists, R13 (parse_tracklist, apply_edits)
4matic Nov 11, 2026
30fb910
fix(rust): lowercase for the dedup key from generated tables, not the…
4matic Nov 11, 2026
62a2cd4
feat(site): Rust in the playground code panels
4matic Nov 11, 2026
37bcb4d
docs(site): a Rust tab on every example, Rust in the reference and pr…
4matic Nov 11, 2026
2b13c13
docs: the Rust port in the README and AGENTS.md
4matic Nov 11, 2026
96e229f
docs: fixture and test counts after the emphasis pairing fix (13,130 …
4matic Nov 11, 2026
ec61c01
feat(rust): serde feature, and the public API ready for publishing
4matic Nov 11, 2026
73918f7
docs(rust): README for crates.io, replacing the planned stub
4matic Nov 11, 2026
623839d
ci(rust): release-please component in the linked group and a crates.i…
4matic Nov 11, 2026
4756e24
ci(rust): pin the crates.io auth action to a commit and drop the tool…
4matic Nov 11, 2026
e51804c
docs: reconcile the Rust statements with the final crate and the rele…
4matic Nov 11, 2026
fcaae38
ci(rust): re-publish input for crates.io, and run the JS comparison w…
4matic Nov 11, 2026
04ff0a9
fix(rust): keep the R9.2 dedup near-linear on thousands of duplicate …
4matic Nov 11, 2026
97d2e81
fix(rust): settle the public API before the first publish
4matic Nov 11, 2026
0ce33d5
docs(rust): Unicode version, performance and serde edge cases in the …
4matic Nov 11, 2026
e327ab4
build(rust): commit Cargo.lock so the MSRV job resolves the same depe…
4matic Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 94 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: release

# release-please keeps a "chore: release" PR up to date from conventional commits on main.
# Merging that PR tags js-vX.Y.Z / spec-vX.Y.Z / python-vX.Y.Z, creates the GitHub Releases, and
# publishes to npm and PyPI.
# Merging that PR tags js-vX.Y.Z / spec-vX.Y.Z / python-vX.Y.Z / rust-vX.Y.Z, creates the GitHub
# Releases, and publishes to npm, PyPI and (once enabled) crates.io.

on:
push:
Expand All @@ -13,6 +13,10 @@ on:
description: "Re-publish an existing python release tag to PyPI (e.g. python-v0.2.0). Leave empty for a normal release-please run."
required: false
default: ""
rust_tag:
description: "Re-publish an existing rust release tag to crates.io (e.g. rust-v0.5.0). Leave empty for a normal release-please run."
required: false
default: ""

permissions: {}

Expand All @@ -33,6 +37,9 @@ jobs:
python_release_created: ${{ steps.release.outputs['python--release_created'] }}
python_tag_name: ${{ steps.release.outputs['python--tag_name'] }}
python_version: ${{ steps.release.outputs['python--version'] }}
rust_release_created: ${{ steps.release.outputs['rust--release_created'] }}
rust_tag_name: ${{ steps.release.outputs['rust--tag_name'] }}
rust_version: ${{ steps.release.outputs['rust--version'] }}
steps:
- uses: googleapis/release-please-action@v4
id: release
Expand Down Expand Up @@ -233,3 +240,88 @@ jobs:
EOF
# The npm release (js-vX.Y.Z) stays "Latest"; don't touch that flag here.
gh release edit "$TAG" --notes-file notes.md

# crates.io trusted publishing (OIDC, no stored token). It can only be configured for a crate
# that already exists, so the very first `cargo publish` is done by the maintainer by hand.
# After that: on crates.io add a trusted publisher for 4matic/trackparse, workflow release.yml,
# environment "crates", then set the repository variable CRATES_PUBLISH to "true".
publish-crates:
needs: release-please
if: vars.CRATES_PUBLISH == 'true' && (needs.release-please.outputs.rust_release_created == 'true' || (github.event_name == 'workflow_dispatch' && inputs.rust_tag != ''))
runs-on: ubuntu-latest
environment:
name: crates
url: https://crates.io/crates/trackparse
permissions:
contents: write # attach the .crate file to the GitHub Release
id-token: write # crates.io trusted publishing (OIDC)
steps:
- name: Resolve the release tag
id: tag
env:
RELEASED_TAG: ${{ steps.tag.outputs.tag }}
RELEASED_VERSION: ${{ steps.tag.outputs.version }}
INPUT_TAG: ${{ inputs.rust_tag }}
run: |
if [ -n "$INPUT_TAG" ]; then
if ! printf '%s' "$INPUT_TAG" | grep -Eq '^rust-v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "rust_tag must look like rust-vX.Y.Z" >&2
exit 1
fi
tag="$INPUT_TAG"
version="${INPUT_TAG#rust-v}"
else
tag="$RELEASED_TAG"
version="$RELEASED_VERSION"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
ref: ${{ steps.tag.outputs.tag }}
# The runner image ships stable Rust; no third-party toolchain action in the publishing job.
- run: rustup update stable --no-self-update && rustup default stable
- name: Verify versions are in sync
env:
TAG_VERSION: ${{ steps.tag.outputs.version }}
run: |
rs_version=$(python3 -c 'import tomllib; print(tomllib.load(open("rust/Cargo.toml", "rb"))["package"]["version"])')
spec_version=$(cat spec/VERSION)
echo "rust=$rs_version spec=$spec_version tag=$TAG_VERSION"
test "$rs_version" = "$TAG_VERSION"
test "$spec_version" = "$TAG_VERSION"
- name: Test
working-directory: rust
run: cargo test --all-features
- name: Package
working-directory: rust
run: cargo package
- uses: rust-lang/crates-io-auth-action@3268eb413133e2960fa4ae0e963ca76380c54cd9 # v1.0.6
id: auth
- name: Publish to crates.io
working-directory: rust
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish
- name: Attach the crate file and install notes to the GitHub Release
working-directory: rust
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.tag.outputs.tag }}
VERSION: ${{ steps.tag.outputs.version }}
run: |
gh release upload "$TAG" target/package/*.crate --clobber
highlights="../.github/release-notes/${VERSION}.md"
{
if [ -f "$highlights" ]; then cat "$highlights"; echo; fi
gh release view "$TAG" --json body --jq .body
echo
echo "### Install"
echo
echo '```sh'
echo "cargo add trackparse@${VERSION}"
echo '```'
echo
echo "crates.io: https://crates.io/crates/trackparse/${VERSION} · docs: https://docs.rs/trackparse/${VERSION}"
} > notes.md
gh release edit "$TAG" --notes-file notes.md
74 changes: 74 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: rust

on:
push:
branches: [main]
pull_request:
paths:
- "rust/**"
- "spec/**"
# The compare job diffs the crate against the built JS package.
- "js/src/**"
- "scripts/compare-ports.mjs"
- ".github/workflows/rust.yml"

permissions:
contents: read

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# stable, and the minimum supported Rust version from rust/Cargo.toml (rust-version).
toolchain: [stable, "1.74.0"]
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Data codegen is up to date
run: node scripts/gen_data.mjs --check
- if: matrix.toolchain == 'stable'
run: cargo fmt --check
- if: matrix.toolchain == 'stable'
run: cargo clippy --all-targets --all-features -- -D warnings
# Every shared fixture, the invariants and the API tests.
- run: cargo test --locked
- if: matrix.toolchain == 'stable'
run: cargo test --all-features
- if: matrix.toolchain == 'stable'
name: The crate packages cleanly
run: cargo publish --dry-run

# Every fixture input through the built JS package and the Rust crate: full outputs must match.
compare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm --filter trackparse build
- run: node scripts/compare-ports.mjs --only=rust
6 changes: 4 additions & 2 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ jobs:
run: pnpm --filter @trackparse/fixture-gen test
- name: Port data codegen is up to date
run: pnpm --filter trackparse gen:data:check
- name: js, python and spec versions are linked
- name: js, python, rust and spec versions are linked
run: |
js_version=$(node -p "require('./js/package.json').version")
py_version=$(python3 -c 'import tomllib; print(tomllib.load(open("python/pyproject.toml", "rb"))["project"]["version"])')
rs_version=$(python3 -c 'import tomllib; print(tomllib.load(open("rust/Cargo.toml", "rb"))["package"]["version"])')
spec_version=$(cat spec/VERSION)
echo "js=$js_version python=$py_version spec=$spec_version"
echo "js=$js_version python=$py_version rust=$rs_version spec=$spec_version"
test "$js_version" = "$spec_version"
test "$py_version" = "$spec_version"
test "$rs_version" = "$spec_version"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ python/dist/

# Rust
target/
rust/Cargo.lock

# Editors / OS
.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"js": "0.4.0",
"spec": "0.4.0",
"python": "0.4.0"
"python": "0.4.0",
"rust": "0.4.0"
}
Loading
Loading