Skip to content

Commit

Permalink
Automatically perform semvar releases (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kixelated authored Apr 9, 2024
1 parent d9d10cd commit 73d9047
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ jobs:
with:
service: ${{env.SERVICE}}
image: ${{env.REGISTRY}}/${{env.IMAGE}}

# Publish any new crate versions
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ jobs:

# Check for unused dependencies
- uses: bnjbvr/cargo-machete@main

# Check for semvar violations
- uses: obi1kenobi/cargo-semver-checks-action@v2
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion moq-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Luke Curley"]
repository = "https://github.com/kixelated/moq-rs"
license = "MIT OR Apache-2.0"

version = "0.0.1"
version = "0.1.0"
edition = "2021"

keywords = ["quic", "http3", "webtransport", "media", "live"]
Expand Down
4 changes: 2 additions & 2 deletions moq-clock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Luke Curley"]
repository = "https://github.com/kixelated/moq-rs"
license = "MIT OR Apache-2.0"

version = "0.3.0"
version = "0.4.0"
edition = "2021"

keywords = ["quic", "http3", "webtransport", "media", "live"]
Expand All @@ -14,7 +14,7 @@ categories = ["multimedia", "network-programming", "web-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
moq-transport = { path = "../moq-transport", version = "0.3" }
moq-transport = { path = "../moq-transport", version = "0.4" }

# QUIC
quinn = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions moq-pub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Mike English", "Luke Curley"]
repository = "https://github.com/kixelated/moq-rs"
license = "MIT OR Apache-2.0"

version = "0.3.0"
version = "0.4.0"
edition = "2021"

keywords = ["quic", "http3", "webtransport", "media", "live"]
Expand All @@ -14,7 +14,7 @@ categories = ["multimedia", "network-programming", "web-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
moq-transport = { path = "../moq-transport", version = "0.3" }
moq-transport = { path = "../moq-transport", version = "0.4" }

# QUIC
quinn = "0.10"
Expand Down
6 changes: 3 additions & 3 deletions moq-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ authors = ["Luke Curley"]
repository = "https://github.com/kixelated/moq-rs"
license = "MIT OR Apache-2.0"

version = "0.3.0"
version = "0.4.0"
edition = "2021"

keywords = ["quic", "http3", "webtransport", "media", "live"]
categories = ["multimedia", "network-programming", "web-programming"]

[dependencies]
moq-transport = { path = "../moq-transport", version = "0.3" }
moq-api = { path = "../moq-api", version = "0.0.1" }
moq-transport = { path = "../moq-transport", version = "0.4" }
moq-api = { path = "../moq-api", version = "0.1.0" }

# QUIC
quinn = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion moq-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Luke Curley"]
repository = "https://github.com/kixelated/moq-rs"
license = "MIT OR Apache-2.0"

version = "0.3.0"
version = "0.4.0"
edition = "2021"

keywords = ["quic", "http3", "webtransport", "media", "live"]
Expand Down
28 changes: 28 additions & 0 deletions moq-transport/src/setup/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ impl Encode for Client {
Ok(())
}
}

#[cfg(test)]
mod tests {
use super::*;
use crate::setup::Version;
use bytes::BytesMut;

#[test]
fn encode_decode() {
let mut buf = BytesMut::new();
let client = Client {
versions: [Version::DRAFT_03].into(),
role: Role::Both,
params: Params::default(),
};

client.encode(&mut buf).unwrap();
assert_eq!(
buf.to_vec(),
vec![0x40, 0x40, 0x01, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x03]
);

let decoded = Client::decode(&mut buf).unwrap();
assert_eq!(decoded.versions, client.versions);
assert_eq!(decoded.role, client.role);
//assert_eq!(decoded.params, client.params);
}
}
27 changes: 27 additions & 0 deletions moq-transport/src/setup/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,30 @@ impl Encode for Server {
Ok(())
}
}

#[cfg(test)]
mod tests {
use super::*;
use crate::setup::Role;
use bytes::BytesMut;

#[test]
fn encode_decode() {
let mut buf = BytesMut::new();
let client = Server {
version: Version::DRAFT_03,
role: Role::Both,
params: Params::default(),
};

client.encode(&mut buf).unwrap();
assert_eq!(
buf.to_vec(),
vec![0x40, 0x41, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x03]
);

let decoded = Server::decode(&mut buf).unwrap();
assert_eq!(decoded.version, client.version);
assert_eq!(decoded.role, client.role);
}
}

0 comments on commit 73d9047

Please sign in to comment.