Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
340 commits
Select commit Hold shift + click to select a range
1d7c5f0
feat(chpl): ChapterListEntries <- Iterator<ChapterEntry>
jvatic Aug 8, 2025
15ddda7
feat(chpl): ChapterEntry constructor
jvatic Aug 8, 2025
82baeae
feat(Metadata): audio_track_iter
jvatic Aug 8, 2025
925fa8f
feat(Metadata): add_or_replace_chpl
jvatic Aug 8, 2025
0daf41d
feat: add ChapterTrack builder
jvatic Aug 8, 2025
78437c3
fix(mp4dump): avoid overflow
jvatic Aug 8, 2025
8a72b97
fix: use mp4 timestamps for default values
jvatic Aug 8, 2025
e44ae1f
fixup: ChapterTrack builder
jvatic Aug 8, 2025
37a5040
feat(Metadata): helper methods for adding chapter track
jvatic Aug 8, 2025
14eda79
fixup: timestamps
jvatic Aug 8, 2025
2b5294c
WIP chapter track builder
jvatic Aug 8, 2025
daf3109
WIP
jvatic Aug 8, 2025
2e9ba02
WIP
jvatic Aug 8, 2025
48bae53
WIP ChapterTrack builder
jvatic Aug 8, 2025
2a4839a
WIP: chapter track builder
jvatic Aug 8, 2025
9d51899
fix(stts): remove validation
jvatic Aug 8, 2025
bf69263
WIP: ChapterTrack builder
jvatic Aug 8, 2025
b82c05c
chpl: add constructor
jvatic Aug 9, 2025
aaf024c
fix(parser): find UDTA atom inside of MOOV
jvatic Aug 9, 2025
c0f8417
feat: working ChapterTrack builder
jvatic Aug 9, 2025
1d6a76d
fix(chpl): remove unused import
jvatic Aug 9, 2025
5303a25
fix: cargo clippy --fix
jvatic Aug 9, 2025
c86befb
WIP(Metadata): refactor
jvatic Aug 9, 2025
f42bd66
refactor Metadata
jvatic Aug 9, 2025
4b07f5f
WIP refactoring
jvatic Aug 9, 2025
ccd7cb1
WIP: refactoring
jvatic Aug 9, 2025
3fa84ac
WIP: refactoring
jvatic Aug 10, 2025
5f6c268
WIP: refactoring
jvatic Aug 10, 2025
0f7caf3
WIP: refactoring
jvatic Aug 10, 2025
262601b
WIP: refactoring
jvatic Aug 10, 2025
60ed4d0
WIP: trim_start, trim_end
jvatic Aug 10, 2025
11e0533
WIP: trim_start, trim_end
jvatic Aug 11, 2025
f1a09cb
WIP: trim_start, trim_end
jvatic Aug 11, 2025
fb2a174
cargo clippy --fix
jvatic Aug 11, 2025
929a865
add TODOs
jvatic Aug 11, 2025
a031f85
feat(ilst): make it easy to construct metadata
jvatic Aug 13, 2025
d2fb074
fix: cargo clippy pedantic
jvatic Aug 22, 2025
a30e733
fix(stsd): parse background color correctly
jvatic Aug 23, 2025
4503a9e
fix(parser): ignore doc comment example
jvatic Aug 23, 2025
e70a3cd
fix(chapter_track_builder): fix test
jvatic Aug 23, 2025
021b7bb
chore(chunk_offset_builder): testing & refactoring
jvatic Aug 23, 2025
2534083
chore(parser): minor refactoring
jvatic Aug 23, 2025
8b1526c
chore: test trim_start, add builders for related atoms
jvatic Aug 23, 2025
e66efdd
chore: refactor trim_start logic to be capable of trimming from anywhere
jvatic Aug 24, 2025
a3fea8a
fixup: use math instead of iteration to trim duration from anywhere
jvatic Aug 24, 2025
a13e1aa
fixup: further optimizations
jvatic Aug 25, 2025
97522df
fixup: trim_duration replaces trim_start
jvatic Aug 25, 2025
c0d2fff
fixup: remove trim_end fns
jvatic Aug 25, 2025
45c74b2
fixup: trim_duration tests
jvatic Aug 25, 2025
08582a0
fixup: fix trim_end and don't deprecate trim_{start|end}
jvatic Aug 25, 2025
e082c6c
fixup: rediculous test cases from the LLM—TODO: clean up the tests
jvatic Aug 25, 2025
0af1759
chore: singleton collection builder method can only be called once
jvatic Aug 25, 2025
121b65f
fix(breaking): SampleSizeAtomBuilder enforces only setting entry_size…
jvatic Aug 25, 2025
df0792b
fixup: cleanup trim test cases
jvatic Aug 25, 2025
eb881f0
WIP: fix trim_duration & tests
jvatic Aug 25, 2025
04c393c
WIP: trim_duration: fix stts trim_duration impl
jvatic Aug 25, 2025
58322ad
WIP: fixing stsc remove_sample_indices
jvatic Aug 26, 2025
8f339f9
WIP: stsc remove_sample_indices: fix removing samples from non-bounda…
jvatic Aug 26, 2025
54e26cd
WIP: trim_duration: stco remove_chunks takes a slice of ranges
jvatic Aug 26, 2025
0f79292
WIP: trim_duration: refactor parser tests
jvatic Aug 26, 2025
e0a0051
WIP: trim_duration: remove DEBUG prints
jvatic Aug 26, 2025
784eb8b
chore(atom::util::time): refactor tests (each case is it's own test)
jvatic Aug 26, 2025
89b02ac
WIP: trim_druation: fix some stts cases
jvatic Aug 26, 2025
0a81bb6
WIP: trim_duration: fix some stts trim_duration calculations
jvatic Aug 26, 2025
51b9e25
WIP: trim_duration: fix remaining issues to get parser tests passing
jvatic Aug 26, 2025
da12b6c
WIP: trim duration with multiple ranges
jvatic Aug 26, 2025
ec6e7cd
fixup: WIP trim duration with multiple ranges
jvatic Aug 26, 2025
3ba0cb9
fixup: WIP trim_duration with multiple ranges
jvatic Aug 26, 2025
7f3ffdc
feat: trim duration builder & make atom trim fns private
jvatic Aug 27, 2025
e2a330b
feat: add MoovAtomRefMut::retain_duration
jvatic Aug 27, 2025
cb7bf79
chore: WIP: refactor stsc & stts trim logic
jvatic Aug 27, 2025
5422ec2
chore(stco): minor refactor
jvatic Aug 28, 2025
b504b89
chore: util exports exerything form private sub-mods
jvatic Aug 28, 2025
f60268c
chore: impl Parse for AtomData
jvatic Aug 28, 2025
f252c61
chore: cargo clippy --fix
jvatic Aug 28, 2025
824307c
chore: Parse -> ParseAtom, add some doc comments
jvatic Aug 28, 2025
c82d6bf
chore: update README
jvatic Aug 28, 2025
61e4be1
fix: use typestate for seek/non-seek variants
jvatic Aug 29, 2025
8b3b134
chore: reorganize mods
jvatic Aug 29, 2025
c2093cb
chore: add doc comment explaining what each example does
jvatic Sep 1, 2025
ce8d874
fix: stsz `to_vec` doc comment
jvatic Sep 1, 2025
a84e459
WIP: refactor to use winnow for parsing atoms
jvatic Sep 18, 2025
061c277
fix(dref): round-trip unknown entry types
jvatic Sep 18, 2025
b277bd2
WIP(dref): move parsing logic into parser sub-module
jvatic Sep 18, 2025
2ec3ee3
WIP(dref): refactor parser
jvatic Sep 18, 2025
36f7cab
WIP(dref): refactor serialization logic
jvatic Sep 18, 2025
6c9b784
WIP(chpl): refactor parser & serialization
jvatic Sep 21, 2025
b63d68a
WIP(util/parser,chpl,dref): version1->version
jvatic Sep 21, 2025
586e023
WIP(elst): refactor serialize/parse
jvatic Sep 21, 2025
84a5cbb
fixup(dref): add traces
jvatic Sep 21, 2025
a8e4767
fixup(chpl): add traces
jvatic Sep 21, 2025
1fef926
WIP(free): minor refactor
jvatic Sep 21, 2025
bcf583b
WIP(ftyp): refactor parser
jvatic Sep 21, 2025
8aaf4a0
WIP(gmhd): clean up comment
jvatic Sep 21, 2025
81c6302
WIP(hdlr): refactor parser/serializer
jvatic Sep 22, 2025
4afde66
WIP(ilst): refactor parser/serializer
jvatic Sep 22, 2025
03903d0
fixup(hdlr): remove redundand to_string
jvatic Sep 22, 2025
2791e25
fixup(chpl): use take vs repeat where possible
jvatic Sep 22, 2025
de6d829
fixup(dref): use take vs repeat where possible
jvatic Sep 22, 2025
a728fbf
WIP(mdhd): move LanguageCode definition into macro_rules
jvatic Sep 22, 2025
b38dabd
WIP(mdhd): make LanguageCode non_exhaustive
jvatic Sep 22, 2025
852d66a
WIP(mdhd): refactor parser/serializer
jvatic Sep 22, 2025
7825747
fixup(chpl): remove unused import
jvatic Sep 22, 2025
bdbc014
WIP(mvhd): refactor parser/serializer
jvatic Sep 23, 2025
eee4fed
WIP(sbgp): refactor serializer/parser
jvatic Sep 23, 2025
6b0b3a7
WIP(sgpd): refactor parser: TODO: tests
jvatic Sep 23, 2025
bfda566
WIP(chpl): fix parser/serializer
jvatic Sep 23, 2025
de1252c
WIP(mdhd): preserve version=1 when it doesn't need to be
jvatic Sep 23, 2025
7439c06
WIP(chpl): add test data
jvatic Sep 23, 2025
bb19a76
WIP(atom): remove sbgp and sgpd parser/serializer
jvatic Sep 23, 2025
4415daf
WIP(dref): use take_vec parser
jvatic Sep 23, 2025
5b6791f
WIP(mvhd,util): add util::serializer
jvatic Sep 23, 2025
85d7b69
WIP(smhd): refactor parser/serializer
jvatic Sep 23, 2025
a01fcd7
WIP(stco_co64): refactor serializer/parser
jvatic Sep 23, 2025
932218d
WIP(stsc): refactor serializer/parser
jvatic Sep 23, 2025
61c8385
WIP(atom): stsd refactor parser WIP
jvatic Sep 23, 2025
5bc1010
chore(test-data): add more test data
jvatic Sep 23, 2025
9e884b7
chore(test-data-review): add two stsd test files for review
jvatic Sep 23, 2025
8aeb151
WIP(stsd): move some test files -> test-data-review
jvatic Sep 24, 2025
49802b3
WIP(co64): add test-data
jvatic Sep 25, 2025
62edc93
WIP(stsd): add test data for esds & btrt extensions
jvatic Sep 25, 2025
c9256f7
WIP(stsd): refactor serializer/parser
jvatic Sep 25, 2025
ef2acbe
chore: refactor common parsers/combinators
jvatic Sep 25, 2025
44c73a1
WIP: refactor winnow parsers
jvatic Sep 25, 2025
3acaf94
WIP(stsd): move mp4a & tx3g sample entries -> own mods
jvatic Sep 25, 2025
89dc1ab
WIP(esds): audio specific config
jvatic Sep 26, 2025
1a4827c
WIP: add test data
jvatic Sep 26, 2025
387145b
WIP(esds): minor fixes to audio_specific_config
jvatic Sep 26, 2025
3058034
WIP(stts): refactor parser/serializer
jvatic Sep 30, 2025
f219f09
WIP(mdhd): refactor LanguageCode (de)serialization
jvatic Sep 30, 2025
96af353
WIP(tref): refactor parser/serializer
jvatic Sep 30, 2025
a8e54f8
WIP(stsc): fix typo
jvatic Sep 30, 2025
b79b2a2
WIP(tref): remove unused imports
jvatic Sep 30, 2025
b05aefd
WIP(tkhd): refactor parser/serializer
jvatic Sep 30, 2025
65a7aa9
WIP(stsz): refactor parser/serializer
jvatic Sep 30, 2025
77d9e72
WIP(test_utils): improve comparing bytes
jvatic Oct 1, 2025
001f983
WIP(test_utils): improve binary comparison
jvatic Oct 1, 2025
f5f94c9
WIP(stsd): add test data (currently causing test to fail)
jvatic Oct 1, 2025
3f04ff8
fix(serializer): fix Packer handling of empty partial byte
jvatic Oct 1, 2025
d821209
WIP(stsd/tx3g): fix font_style
jvatic Oct 1, 2025
12a253d
WIP(stsd/tx3g): remove default_ prefix from fields
jvatic Oct 1, 2025
9c53b5d
WIP(test_utils): fix index out of bounds
jvatic Oct 1, 2025
f20271b
WIP(stsd): fix encoding extensions (encode fourcc)
jvatic Oct 1, 2025
bc8cae9
revert: stsd, chapter_track_builder
jvatic Oct 1, 2025
16703f8
WIP(parser): add be_{u,i}32_as parsers
jvatic Oct 1, 2025
5d3edae
WIP(elst): refactor parser / serializer (use more helpers)
jvatic Oct 1, 2025
3da732d
WIP(stsd): fixed_point_16x16 serialization
jvatic Oct 1, 2025
15b2791
WIP(stsd)
jvatic Oct 1, 2025
ba74b0d
WIP(stsd): test-data
jvatic Oct 1, 2025
aa79df5
WIP(stsd): refactoring
jvatic Oct 1, 2025
55a3be4
WIP(test-data): stsd0{0,3}.bin: fix zero byte showing up as 0x04
jvatic Oct 2, 2025
cf7acf3
WIP(test-data): stsd09.bin: fix predefined
jvatic Oct 2, 2025
c538825
fix(test_utils): fix panic when no matched triling bytes
jvatic Oct 2, 2025
4e4817c
WIP(stsd): update test data
jvatic Oct 2, 2025
567ea5c
WIP(stsd): refactor parser
jvatic Oct 2, 2025
f020111
WIP(test-data): remove duplicate files
jvatic Oct 2, 2025
b7d4788
fix(free): FreeAtom also handles SKIP
jvatic Oct 2, 2025
73f0a3c
WIP(gmhd): gmhd is a container for gmin and text
jvatic Oct 2, 2025
d3b9ffa
fix(stsd,chapter_track_builder): correctly handle stsd text entry
jvatic Oct 2, 2025
a662ff3
WIP(chapter_track_builder): change default handler name
jvatic Oct 3, 2025
d301a83
WIP(atom): cleanup unused fns
jvatic Oct 3, 2025
2f73645
WIP(atom): move ColorRgb into util vs util::parser
jvatic Oct 3, 2025
09d4543
WIP(atom): refactor fmt::Debug impls
jvatic Oct 3, 2025
cef2822
chore: remove mp4parse dependency
jvatic Oct 4, 2025
176bf54
WIP(stsd): refactor audio specific config parser/serializer
jvatic Oct 4, 2025
d7fd0cb
fix(chapter_track_builder): fix test (we removed min_padding)
jvatic Oct 4, 2025
a691954
WIP(stsd): fix audio specific config
jvatic Oct 4, 2025
2c9839b
WIP(stsd): clean up audio specific config
jvatic Oct 4, 2025
f08dac0
chore: add test data
jvatic Oct 4, 2025
02e2fe4
WIP(stsd): round-trip predefined, remove useless tests
jvatic Oct 4, 2025
cf6ec45
WIP(stsd): extensions use smallest descriptor length possible, remove…
jvatic Oct 4, 2025
e5c1c6e
chore: refactor serializer prepend_size to handle both inclusive and …
jvatic Oct 9, 2025
f013dfb
WIP(stsd): refactor serializers
jvatic Oct 9, 2025
4027a04
WIP: refactor serializer: fns return [u8; const] where possible
jvatic Oct 9, 2025
3ffb961
chore: refactor AtomData into macro_rules
jvatic Oct 10, 2025
3e5d84f
chore: minor refactoring (comments/var name)
jvatic Oct 10, 2025
f48db2e
chore: clean up dependencies
jvatic Nov 21, 2025
3ec5767
chore: refactor test utils in preperation for more complex tests
jvatic Nov 22, 2025
3cd9a15
chore: make test_utils available with a feature flag
jvatic Nov 23, 2025
9b473b6
WIP: integration tests
jvatic Nov 23, 2025
24b3fd1
chore: remove stale TODO comment
jvatic Nov 23, 2025
e5be399
fix(stts): handle duration being trimmed from a single sample
jvatic Nov 23, 2025
7517845
fixup(stts): handle removing partial sample in sample entry
jvatic Nov 23, 2025
960868e
fix(stsc): fix off-by-1 when calculating chunk count for last entry
jvatic Nov 24, 2025
b9438da
chore(stsc): test_remove_sample_indices! case can override default st…
jvatic Nov 24, 2025
b30af62
fix(stsc): don't duplicate entries when removing only whole chunks
jvatic Nov 24, 2025
7de3477
feat: return total size when updating chunk offsets
jvatic Nov 24, 2025
54cd242
chore(moov): refactor test_moov_trim_duration to allow for more compl…
jvatic Nov 25, 2025
40eaa80
fix(stts): fix trim_duration when multiple trim ranges apply to a sin…
jvatic Nov 25, 2025
33770c4
fix(stsz): fix removing multiple ranges of sample indicies
jvatic Nov 25, 2025
283e979
fix(stco_co64): fix remove_chunk_indices when multiple ranges
jvatic Nov 25, 2025
9695fd4
fix(stsc): fix remove_sample_indices when multiple entries to remove
jvatic Nov 25, 2025
382ca4c
fix(stts): fix trim_duration when multiple entries to remove
jvatic Nov 25, 2025
dd8b3fe
chore(util): derive(Debug) for RangeCollection
jvatic Nov 25, 2025
4357b44
chore(moov): test trim duration from start and end at the same time
jvatic Nov 25, 2025
286a42e
chore(text,gmin): impl(Default) for {Base,Text}MediaInfoAtom
jvatic Nov 25, 2025
263d7fd
chore(moov): add trim duration tests with multi track & multi chunk c…
jvatic Nov 25, 2025
a5b2e21
chore(stsc): add test case for removing first and last entry at the s…
jvatic Nov 26, 2025
4a14890
fix(moov): trim_duration_ranges subtracts the longest trimmed duratio…
jvatic Nov 26, 2025
a89fdf4
fix(trim_duration): trust the calculated duration in stts vs what's i…
jvatic Nov 26, 2025
d7cd19e
fix(trim_duration): use the first audio track's duration for the moov…
jvatic Nov 26, 2025
c6b06d3
fix(moov): trim_duration bounds are inclusive
jvatic Nov 26, 2025
e14094d
feat(moov): retain_duration is a builder to make it easier to use
jvatic Nov 26, 2025
bebf12f
fix(stts): trim_duration when trimming nothing from the beginning
jvatic Nov 27, 2025
52471af
fix(stsc): remove_sample_indices with multiple ranges for a single entry
jvatic Nov 27, 2025
8ebf0d5
chore(chapter_track_builder): use builders where available vs struct …
jvatic Nov 27, 2025
f435d6d
feat(TrakAtomRef): add edit_list_container -> EdtsAtomRef
jvatic Nov 27, 2025
b377823
chore: replace RangeCollection with RangeSet
jvatic Nov 27, 2025
e1fd6cd
fix(elst): EditEntry builder uses movie_timescale to translate `Durat…
jvatic Nov 27, 2025
40916bd
chore(trim_duration): use RangeSet<T> instead of Vec<Range<T>>
jvatic Nov 27, 2025
be044b9
fix(stsc): fix/refactor remove_sample_indices and add more test cases
jvatic Nov 28, 2025
f80d549
fix(stts): don't attempt to trim within a single sample
jvatic Nov 28, 2025
d9ccb5e
fix(Cargo.toml): include tokio as an optional dep
jvatic Nov 28, 2025
a4a18db
fix(stsz): use RangeSet
jvatic Nov 28, 2025
3af0ca8
chore(Cargo.toml): now matches checked in Cargo.toml
jvatic Nov 28, 2025
fe445da
chore: we actually don't need test-utils exposed as a feature for int…
jvatic Nov 28, 2025
97bf40b
chore(examples): mp4copy can output to stdout
jvatic Nov 29, 2025
0e9857e
fix(stts): don't test that a sample's duration will be trimmed
jvatic Nov 29, 2025
3504b4b
WIP(integration tests): mp4copy snapshot test is working/passing
jvatic Nov 29, 2025
0df164f
chore(integration tests): test all permutations of mp4copy
jvatic Nov 29, 2025
6cb23f5
WIP(trim_duration): plumbing for inserting/adjusting chunk offsets
jvatic Dec 6, 2025
0ebb01c
WIP(trim_duration): simplify stsc logic and handle all cases
jvatic Dec 8, 2025
abdbb35
WIP(trim_duration): stsc/trak/stco adjust and insert chunks in additi…
jvatic Dec 8, 2025
72a6e87
WIP(trim_duration): convert trim ranges to bounded & replace any edit…
jvatic Dec 8, 2025
0c0c443
WIP(trim_duration): test trimming start of chunk updates it's offset
jvatic Dec 8, 2025
f822b9d
WIP(trim_duration): make TrimDuration#ranges private + minor adjustments
jvatic Dec 8, 2025
67413c0
fixup(trim_duration): trak comments
jvatic Dec 8, 2025
23ada6a
feat(examples/mp4copy): include args to trim or retain time ranges
jvatic Dec 9, 2025
0eb4274
fix(tests): example_test uses expected hash from test case
jvatic Jan 1, 2026
24f830e
fix(stco): remove unused import
jvatic Jan 1, 2026
27e9170
chore(hdlr,fourcc): hdlr type, and {component,manufacturer}_type are …
jvatic Jan 1, 2026
63ae840
chore: refactor: atom data parsers are sync, reader in own mod, use F…
jvatic Jan 3, 2026
cc07514
chore: don't use release build for example tests (the files being tes…
jvatic Jan 4, 2026
9612112
chore: remove dbg!
jvatic Feb 7, 2026
78b76a3
feat: add MoovAtomRef::next_track_id
jvatic Feb 15, 2026
65ed113
chore: remove EditListAtom::trim_ranges
jvatic Feb 15, 2026
77ed97a
chore!: `experimental-trim` feature flag now required to access trim …
jvatic Feb 15, 2026
df9e5d2
chore: add README
jvatic Feb 15, 2026
c018a5a
chore: add CODE_OF_CONDUCT
jvatic Feb 15, 2026
28c7419
chore: add license
jvatic Feb 15, 2026
7d6ee7d
chore: add security policy
jvatic Feb 15, 2026
b33d818
chore: add github workflows & cliff config
jvatic Feb 15, 2026
601b225
chore: cargo clippy --fix
jvatic Feb 15, 2026
3a17b73
fix(stts): fix trim_duration assert
jvatic Feb 15, 2026
e8094f5
fix: clippy warnings
jvatic Feb 15, 2026
ec870f3
chore: update README
jvatic Feb 15, 2026
526d237
fix: release workflow
jvatic Feb 15, 2026
49b08fd
fix: exclude test data from package
jvatic Feb 15, 2026
9163f88
fix(Cargo.toml): add crate description
jvatic Feb 15, 2026
3144786
chore(deps): bump bytes in the cargo group across 1 directory
dependabot[bot] Feb 15, 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
159 changes: 159 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
CARGO_TERM_COLOR: always

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.get-ref.outputs.ref }}
version: ${{ steps.get-ref.outputs.version }}
version_number: ${{ steps.get-ref.outputs.version_number }}
steps:
- name: Determine ref and version
id: get-ref
run: |
REF="${{ github.ref }}"
echo "ref=$REF" >> $GITHUB_OUTPUT
# Extract version from ref (remove refs/tags/ prefix if present)
VERSION="${REF#refs/tags/}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Also create version without 'v' prefix for cargo
VERSION_NUMBER="${VERSION#v}"
echo "version_number=$VERSION_NUMBER" >> $GITHUB_OUTPUT
echo "Using ref: $REF"
echo "Using version: $VERSION"
echo "Using version number: $VERSION_NUMBER"

verify-version:
name: Verify version matches tag
needs: setup
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.ref }}

- name: Verify Cargo.toml version matches tag
run: |
TAG_VERSION="${{ needs.setup.outputs.version_number }}"
CRATE_VERSION=$(grep "^version" Cargo.toml | head -1 | cut -d'"' -f2)

echo "Tag version: $TAG_VERSION"
echo "Cargo.toml version: $CRATE_VERSION"

if [ "$TAG_VERSION" != "$CRATE_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) doesn't match Cargo.toml version ($CRATE_VERSION)"
echo "Please ensure the version in Cargo.toml matches the tag you're trying to release."
exit 1
fi
echo "✅ Version check passed!"

test:
name: Run tests
needs: [setup, verify-version]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.ref }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Run tests
run: cargo test --all-features --verbose

- name: Run clippy
run: cargo clippy --all-features -- -D warnings

create-release:
name: Create GitHub Release
needs: [setup, verify-version, test]
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.ref }}
fetch-depth: 0 # Fetch all history for git-cliff

- name: Generate changelog
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --current --strip all
env:
OUTPUT: CHANGELOG.md

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.setup.outputs.version }}
name: Release ${{ needs.setup.outputs.version }}
body: |
## Changes in ${{ needs.setup.outputs.version }}

${{ steps.git-cliff.outputs.content }}

### Installation

#### From crates.io
```bash
cargo add mp4-edit@${{ needs.setup.outputs.version_number }}
```

publish-crate:
name: Publish to crates.io
needs: [setup, create-release]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # Required for OIDC token exchange with crates.io

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.ref }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Get Cargo version for checking
run: |
CRATE_VERSION=$(grep "^version" Cargo.toml | head -1 | cut -d'"' -f2)
echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV

- name: Authenticate with crates.io
uses: rust-lang/crates-io-auth-action@v1
id: auth

- name: Publish to crates.io
run: |
# Try to publish, but don't fail if the version already exists
OUTPUT=$(cargo publish --verbose 2>&1) && echo "$OUTPUT" || {
EXIT_CODE=$?
echo "$OUTPUT"
# Check if it failed because the version already exists
if echo "$OUTPUT" | grep -q "already exists on crates.io"; then
echo "✅ Version $CRATE_VERSION already published on crates.io, skipping..."
exit 0
fi
# If it failed for another reason, exit with the original error code
echo "Error: Publishing failed with error code $EXIT_CODE"
exit $EXIT_CODE
}
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
24 changes: 24 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Rust

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Clippy
run: cargo clippy --verbose
- name: Build
run: cargo build --verbose --all-features
- name: Run tests
run: cargo test --verbose --all-features
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
.DS_Store
129 changes: 129 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
mp4-edit-abuse@zzh.email.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
Loading