Skip to content

Commit

Permalink
Merge pull request #95 from termoshtt/upgrade-dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies, Remove MSRV, start developing 0.3.0
  • Loading branch information
termoshtt committed Apr 6, 2024
2 parents fe933fb + 82b0196 commit c7de671
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 64 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ on:
jobs:
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
version:
- 1.57.0
- stable
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.version }}
toolchain: stable
profile: minimal
default: true
override: true
Expand Down
30 changes: 14 additions & 16 deletions ocipkg-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@
name = "ocipkg-cli"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
license = "MIT OR Apache-2.0"
version = "0.2.8"
version = "0.3.0"
edition = "2021"
rust-version = "1.57.0"
description = "CLI for ocipkg"
documentation = "https://docs.rs/ocipkg-cli"
repository = "https://github.com/termoshtt/ocipkg"
readme = "../README.md"

[dependencies]
base64 = "0.13.0"
cargo_metadata = "0.15.0"
clap = { version = "3.2.8", features = ["derive"] }
colored = "2.0.0"
env_logger = "0.9.0"
# Pinned because newer versions require Rust 1.60 while this crate has a MSRV of 1.57
git2 = "=0.14.2"
log = "0.4.17"
serde_json = "1.0.82"
url = "2.2.2"
oci-spec = "0.5.8"
flate2 = "1.0.25"
tar = "0.4.38"
base64 = "0.22.0"
cargo_metadata = "0.18.1"
clap = { version = "4.5.4", features = ["derive"] }
colored = "2.1.0"
env_logger = "0.11.3"
git2 = "0.18.3"
log = "0.4.21"
serde_json = "1.0.115"
url = "2.5.0"
oci-spec = "0.6.5"
flate2 = "1.0.28"
tar = "0.4.40"

[dependencies.ocipkg]
version = "0.2.0"
version = "0.3.0"
path = "../ocipkg"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion ocipkg-cli/src/bin/cargo-ocipkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn main() -> Result<()> {
.parse_default_env()
.init();

match Opt::from_args() {
match Opt::parse() {
Opt::Ocipkg(Ocipkg::Build {
package_name,
release,
Expand Down
27 changes: 9 additions & 18 deletions ocipkg-cli/src/bin/ocipkg.rs
Original file line number Diff line number Diff line change
@@ -1,58 +1,51 @@
use base64::{engine::general_purpose::STANDARD, Engine};
use clap::Parser;
use flate2::read::GzDecoder;
use oci_spec::image::MediaType;
use ocipkg::error::*;
use std::{fs, path::*};

#[derive(Debug, Parser)]
#[clap(version)]
#[command(version)]
enum Opt {
/// Pack a directory into an oci-archive tar file
Pack {
/// Path of input directory to be packed
#[clap(parse(from_os_str))]
input_directory: PathBuf,

/// Path of output tar archive in oci-archive format
#[clap(parse(from_os_str))]
output: PathBuf,

/// Name of container, use UUID v4 hyphenated if not set.
#[clap(short = 't', long = "tag")]
#[arg(short = 't', long = "tag")]
tag: Option<String>,

/// Path to annotations file.
#[clap(parse(from_os_str), default_value = "ocipkg.toml")]
#[arg(default_value = "ocipkg.toml")]
annotations: PathBuf,
},

/// Compose files into an oci-archive tar file
Compose {
/// Path of input file to be packed
#[clap(parse(from_os_str))]
inputs: Vec<PathBuf>,

/// Path of output tar archive in oci-archive format
#[clap(short = 'o', long = "output", parse(from_os_str))]
#[arg(short = 'o', long = "output")]
output: PathBuf,

/// Name of container, use UUID v4 hyphenated if not set.
#[clap(short = 't', long = "tag")]
#[arg(short = 't', long = "tag")]
tag: Option<String>,

/// Path to annotations file.
#[clap(
long = "annotations",
parse(from_os_str),
default_value = "ocipkg.toml"
)]
#[arg(long = "annotations", default_value = "ocipkg.toml")]
annotations: PathBuf,
},

/// Load and expand container local cache
Load {
/// Input oci-archive
#[clap(parse(from_os_str))]
input: PathBuf,
},

Expand All @@ -64,7 +57,6 @@ enum Opt {
/// Push oci-archive to registry
Push {
/// Input oci-archive
#[clap(parse(from_os_str))]
input: PathBuf,
},

Expand All @@ -88,7 +80,6 @@ enum Opt {
/// Inspect components in OCI archive
Inspect {
/// Input oci-archive
#[clap(parse(from_os_str))]
input: PathBuf,
},
}
Expand All @@ -99,7 +90,7 @@ fn main() -> Result<()> {
.parse_default_env()
.init();

match Opt::from_args() {
match Opt::parse() {
Opt::Pack {
input_directory,
output,
Expand Down Expand Up @@ -178,7 +169,7 @@ fn main() -> Result<()> {
password,
} => {
let url = url::Url::parse(&registry)?;
let octet = base64::encode(format!("{}:{}", username, password,));
let octet = STANDARD.encode(format!("{}:{}", username, password,));
let mut new_auth = ocipkg::distribution::StoredAuth::default();
new_auth.insert(url.domain().unwrap(), octet);
let _token = new_auth.get_token(&url)?;
Expand Down
41 changes: 20 additions & 21 deletions ocipkg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
[package]
name = "ocipkg"
version = "0.2.8"
version = "0.3.0"
authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.57.0"
description = "OCI registry for package distribution"
documentation = "https://docs.rs/ocipkg"
repository = "https://github.com/termoshtt/ocipkg"
readme = "../README.md"

[dependencies]
base16ct = { version = "0.1.1", features = ["alloc"] }
base64 = "0.13.0"
chrono = "0.4.19"
directories = "4.0.1"
flate2 = "1.0.24"
base16ct = { version = "0.2.0", features = ["alloc"] }
base64 = "0.22.0"
chrono = "0.4.37"
directories = "5.0.1"
flate2 = "1.0.28"
lazy_static = "1.4.0"
log = "0.4.17"
oci-spec = "0.5.7"
regex = "1.5.6"
serde = "1.0.137"
serde_json = "1.0.82"
sha2 = "0.10.2"
tar = "0.4.38"
thiserror = "1.0.31"
toml = "0.5.9"
ureq = { version = "2.5.0", features = ["json"] }
url = "2.2.2"
uuid = { version = "1.1.2", features = ["v4"] }
walkdir = "2.3.2"
log = "0.4.21"
oci-spec = "0.6.5"
regex = "1.10.4"
serde = "1.0.197"
serde_json = "1.0.115"
sha2 = "0.10.8"
tar = "0.4.40"
thiserror = "1.0.58"
toml = "0.7.6"
ureq = { version = "2.9.6", features = ["json"] }
url = "2.5.0"
uuid = { version = "1.8.0", features = ["v4"] }
walkdir = "2.5.0"

[dev-dependencies]
maplit = "1.0.2"
2 changes: 1 addition & 1 deletion ocipkg/src/image/annotations/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct OpenContainers {
/// a.to_toml().trim(),
/// r#"
/// [org.opencontainers.image]
/// url = 'https://github.com/termoshtt/ocipkg'
/// url = "https://github.com/termoshtt/ocipkg"
/// "#.trim()
/// );
/// ```
Expand Down

0 comments on commit c7de671

Please sign in to comment.