diff --git a/.crom.toml b/.crom.toml index 2ee6720..c510bf4 100644 --- a/.crom.toml +++ b/.crom.toml @@ -1,19 +1,5 @@ -pattern = 'v0.3.%d' +pattern = 'v0.4.%d' message-template = "Created {version} for release." [cargo] -[artifact.windows] -paths = { "crom.exe" = "windows/crom.exe" } -compress = { name = "crom-windows.zip", format = "zip" } -target = "GitHub" - -[artifact.mac] -paths = {crom = "mac/crom"} -compress = { name = "crom-mac.tar.gz", format = "tgz" } -target = "GitHub" - -[artifact.linux] -paths = {crom = "linux/crom"} -compress = { name = "crom-linux-musl.tar.gz", format = "tgz" } -target = "GitHub" diff --git a/.github/workflows/create-artifacts.yml b/.github/workflows/create-artifacts.yml new file mode 100644 index 0000000..0f29922 --- /dev/null +++ b/.github/workflows/create-artifacts.yml @@ -0,0 +1,93 @@ +name: Publish Image + +on: + workflow_call: + inputs: + version: + required: true + type: string + +jobs: + build-for-os: + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [linux, macos-x86, macos-aarch64] + include: + - build: linux + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - build: macos-x86 + os: macos-latest + target: x86_64-apple-darwin + - build: macos-aarch64 + os: macos-latest + target: aarch64-apple-darwin + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('ci/cache-version') }}- + ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('ci/cache-version') }}- + - name: Install correct version of Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + target: ${{ matrix.target }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: run + args: -- write-version custom ${{ inputs.version }} + - uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose --release --target "${{ matrix.target }}" + - run: | + ls target/${{ matrix.target }}/* + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.target }} + if-no-files-found: error + path: | + target/${{ matrix.target }}/release/crom + + release: + runs-on: ubuntu-latest + needs: build-for-os + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v3 + with: + name: aarch64-apple-darwin + path: artifacts/aarch64-apple-darwin + - uses: actions/download-artifact@v3 + with: + name: x86_64-apple-darwin + path: artifacts/x86_64-apple-darwin + - uses: actions/download-artifact@v3 + with: + name: x86_64-unknown-linux-gnu + path: artifacts/x86_64-unknown-linux-gnu + - name: Create release + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + ls artifacts/*/* + tar -czv --strip-components 1 -f linux-gnu-x86_64.tgz artifacts/x86_64-unknown-linux-gnu/crom + tar -czv --strip-components 1 -f darwin-aarch64.tgz artifacts/aarch64-apple-darwin/crom + tar -czv --strip-components 1 -f darwin-x86_64.tgz artifacts/x86_64-apple-darwin/crom + gh release upload ${{ inputs.version }} linux-gnu-x86_64.tgz darwin-aarch64.tgz darwin-x86_64.tgz diff --git a/.github/workflows/on-main.yml b/.github/workflows/on-main.yml new file mode 100644 index 0000000..d7f1241 --- /dev/null +++ b/.github/workflows/on-main.yml @@ -0,0 +1,85 @@ +on: + push: + branches: + - main + +name: Release + +jobs: + create-release: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + - name: create pre-release + id: version + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + VERSION=$(cargo run -- get next-release) + gh release create $VERSION --generate-notes --target $(git rev-parse HEAD) + echo "::set-output name=version::$VERSION" + + publish: + uses: ./.github/workflows/create-artifacts.yml + needs: create-release + with: + version: ${{ needs.create-release.outputs.version }} + + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + ## Cargo test + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + ## Cargo fmt + - run: rustup component add rustfmt + - name: cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + ## Cargo clippy + - run: rustup component add clippy + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings \ No newline at end of file diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml new file mode 100644 index 0000000..380345a --- /dev/null +++ b/.github/workflows/on-pull-request.yml @@ -0,0 +1,84 @@ +on: [pull_request] + +name: Continuous integration + +jobs: + create-release: + needs: + - check + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + - name: create pre-release + id: version + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + VERSION=$(cargo run -- get pre-release) + gh release create $VERSION --generate-notes --prerelease --target $(git rev-parse HEAD) + echo "::set-output name=version::$VERSION" + + publish: + uses: ./.github/workflows/create-artifacts.yml + needs: create-release + with: + version: ${{ needs.create-release.outputs.version }} + + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + ## Cargo test + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + ## Cargo fmt + - run: rustup component add rustfmt + - name: cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + ## Cargo clippy + - run: rustup component add clippy + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 8eb5386..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Publish Image - -on: - push: - branches: - - master - -jobs: - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: do-build - run: | - mkdir -p target/x86_64-unknown-linux-musl/release/ - docker build . --file Dockerfile --tag crom - docker run --name crom crom help - docker cp crom:/usr/bin/crom target/x86_64-unknown-linux-musl/release/crom - docker rm crom - - name: Upload Artifacts - uses: actions/upload-artifact@v1 - with: - name: linux-artifacts - path: target/x86_64-unknown-linux-musl/release/crom - - build-mac: - runs-on: macos-latest - steps: - - uses: actions/checkout@v1 - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - name: Install latest stable - uses: actions-rs/toolchain@v1 - - uses: actions-rs/cargo@v1 - with: - command: run - args: -- write-version next-release - - uses: actions-rs/cargo@v1 - with: - command: check - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: Upload Artifacts - uses: actions/upload-artifact@v1 - with: - name: mac-artifacts - path: target/release/crom - - release: - runs-on: ubuntu-latest - needs: - - build-linux - - build-mac - steps: - - uses: actions/checkout@v1 - - uses: actions/download-artifact@v1 - with: - name: mac-artifacts - path: artifacts/mac - - uses: actions/download-artifact@v1 - with: - name: linux-artifacts - path: artifacts/linux - - name: Create release - run: | - set -eux - chmod +x artifacts/linux/crom - artifacts/linux/crom tag next-release --local --github - artifacts/linux/crom upload latest --artifact-path=./artifacts linux mac - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - docker-publish: - runs-on: ubuntu-latest - needs: - - release - steps: - - uses: actions/checkout@v1 - - name: login to registry - run: docker login docker.pkg.github.com --username ethankhall --password ${{ secrets.GITHUB_TOKEN }} - - name: Build the Docker image - run: docker build . --file Dockerfile --tag crom - - name: push to registry - run: | - VERSION=$(docker run --rm -v $(pwd):/target crom get latest | sed 's/v//g') - docker tag crom docker.pkg.github.com/ethankhall/crom/cli:$(git rev-parse --short HEAD) - docker tag crom docker.pkg.github.com/ethankhall/crom/cli:latest - docker tag crom docker.pkg.github.com/ethankhall/crom/cli:$VERSION - docker push docker.pkg.github.com/ethankhall/crom/cli:$(git rev-parse --short HEAD) - docker push docker.pkg.github.com/ethankhall/crom/cli:latest - docker push docker.pkg.github.com/ethankhall/crom/cli:$VERSION \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml deleted file mode 100644 index 5828f3e..0000000 --- a/.github/workflows/verify.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Verify PR - -on: - pull_request: - branches: - - master - -jobs: - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - components: clippy - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features - build-docker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: do-build - run: | - mkdir -p target/x86_64-unknown-linux-musl/release/ - docker build . --file Dockerfile --tag crom - docker run --name crom crom help - docker cp crom:/usr/bin/crom target/x86_64-unknown-linux-musl/release/crom - docker rm crom \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index a3f49fa..c4a0ab5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,10 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "addr2line" -version = "0.14.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] @@ -15,12 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "ahash" version = "0.4.7" @@ -29,19 +25,13 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - [[package]] name = "assert-json-diff" version = "2.0.1" @@ -54,13 +44,13 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "1.0.3" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2475b58cd94eb4f70159f4fd8844ba3b807532fe3131b3373fae060bbe30396" +checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" dependencies = [ "bstr", "doc-comment", - "predicates", + "predicates 2.1.1", "predicates-core", "predicates-tree", "wait-timeout", @@ -68,9 +58,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.7" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72c1f1154e234325b50864a349b9c8e56939e266a4c307c0f159812df2f9537" +checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" dependencies = [ "flate2", "futures-core", @@ -81,9 +71,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.48" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" dependencies = [ "proc-macro2", "quote", @@ -103,17 +93,18 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" dependencies = [ "addr2line", + "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", @@ -129,15 +120,15 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bstr" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -146,48 +137,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" - -[[package]] -name = "byteorder" -version = "1.4.3" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" - -[[package]] -name = "bzip2" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.10+1.0.8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" -dependencies = [ - "cc", - "libc", - "pkg-config", -] +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.67" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] @@ -219,28 +183,26 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.2" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" +checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" dependencies = [ "atty", "bitflags", "clap_derive", + "clap_lex", "indexmap", "lazy_static", - "os_str_bytes", "strsim", "termcolor", "textwrap", - "unicode-width", - "vec_map", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.2" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" +checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" dependencies = [ "heck", "proc-macro-error", @@ -249,6 +211,15 @@ dependencies = [ "syn", ] +[[package]] +name = "clap_lex" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "colored" version = "2.0.0" @@ -262,37 +233,19 @@ dependencies = [ [[package]] name = "combine" -version = "3.8.1" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" dependencies = [ - "ascii", - "byteorder", - "either", + "bytes", "memchr", - "unreachable", -] - -[[package]] -name = "console" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "regex", - "terminal_size", - "unicode-width", - "winapi 0.3.9", ] [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -300,15 +253,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] @@ -324,27 +277,20 @@ dependencies = [ "error-chain", "flexi_logger", "git2", - "indicatif", - "json", - "libflate", + "human-panic", "log", - "mime", - "mime_guess", "mockito", - "predicates", + "predicates 1.0.8", "regex", "reqwest", "rust-ini", "serde", "serde_json", - "tar", "tempdir", "tempfile", "tokio", "toml", "toml_edit", - "url", - "zip", ] [[package]] @@ -353,13 +299,19 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "dlv-list" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b391911b9a786312a10cb9d2b3d0735adfd5a8113eb3648de26a75e91b0826c" +checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" dependencies = [ - "rand 0.7.3", + "rand 0.8.5", ] [[package]] @@ -380,17 +332,11 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if 1.0.0", ] @@ -405,11 +351,20 @@ dependencies = [ "version_check", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -419,13 +374,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.20" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if 1.0.0", "crc32fast", - "libc", "miniz_oxide", ] @@ -518,75 +471,48 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures-channel" -version = "0.3.13" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" - -[[package]] -name = "futures-macro" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.13" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.13" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-core", - "futures-macro", "futures-task", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", ] [[package]] name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if 1.0.0", "libc", @@ -595,15 +521,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.23.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "git2" -version = "0.13.17" +version = "0.13.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986" +checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6" dependencies = [ "bitflags", "libc", @@ -620,9 +546,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "h2" -version = "0.3.1" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d832b01df74254fe364568d6ddc294443f61cbec82816b60904303af87efae78" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes", "fnv", @@ -633,7 +559,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.3", "tracing", ] @@ -646,29 +572,32 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + [[package]] name = "heck" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "http" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" dependencies = [ "bytes", "fnv", @@ -677,9 +606,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -688,21 +617,36 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.5" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" -version = "0.3.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "human-panic" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39f357a500abcbd7c5f967c1d45c8838585b36743823b9d43488f24850534e36" +dependencies = [ + "backtrace", + "os_type", + "serde", + "serde_derive", + "termcolor", + "toml", + "uuid", +] [[package]] name = "hyper" -version = "0.14.4" +version = "0.14.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" dependencies = [ "bytes", "futures-channel", @@ -714,7 +658,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project", + "pin-project-lite", "socket2", "tokio", "tower-service", @@ -724,24 +668,22 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ - "futures-util", + "http", "hyper", - "log", "rustls", "tokio", "tokio-rustls", - "webpki", ] [[package]] name = "idna" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -750,24 +692,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.2" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" dependencies = [ "autocfg", - "hashbrown", -] - -[[package]] -name = "indicatif" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" -dependencies = [ - "console", - "lazy_static", - "number_prefix", - "regex", + "hashbrown 0.11.2", ] [[package]] @@ -792,9 +722,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] @@ -810,40 +740,43 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "jobserver" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.49" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - [[package]] name = "kernel32-sys" version = "0.2.2" @@ -868,33 +801,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.90" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae" - -[[package]] -name = "libflate" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158ae2ca09a761eaf6050894f5a6f013f2773dafe24f67bfa73a7504580e2916" -dependencies = [ - "adler32", - "crc32fast", - "libflate_lz77", - "rle-decode-fast", -] - -[[package]] -name = "libflate_lz77" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libgit2-sys" -version = "0.12.18+1.1.0" +version = "0.12.26+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885" +checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494" dependencies = [ "cc", "libc", @@ -904,9 +819,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" dependencies = [ "cc", "libc", @@ -922,33 +837,34 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" @@ -956,24 +872,13 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", - "autocfg", ] [[package]] @@ -989,7 +894,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.2", + "miow", "net2", "slab", "winapi 0.2.8", @@ -997,15 +902,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.10" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" dependencies = [ "libc", "log", - "miow 0.3.6", - "ntapi", - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] @@ -1032,32 +936,22 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "miow" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" -dependencies = [ - "socket2", - "winapi 0.3.9", -] - [[package]] name = "mockito" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10030163d67f681db11810bc486df3149e6d91c8b4f3f96fa8b62b546c2cef8" +checksum = "401edc088069634afaa5f4a29617b36dba683c0c16fe4435a86debad23fa2f1a" dependencies = [ "assert-json-diff", "colored", - "difference", "httparse", "lazy_static", "log", - "rand 0.8.3", + "rand 0.8.5", "regex", "serde_json", "serde_urlencoded", + "similar", ] [[package]] @@ -1079,9 +973,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "notify" -version = "4.0.15" +version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" +checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" dependencies = [ "bitflags", "filetime", @@ -1095,20 +989,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -1116,46 +1001,43 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] -[[package]] -name = "number_prefix" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" - [[package]] name = "object" -version = "0.23.0" +version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.7.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "ordered-multimap" @@ -1164,38 +1046,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" dependencies = [ "dlv-list", - "hashbrown", + "hashbrown 0.9.1", ] [[package]] name = "os_str_bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" + +[[package]] +name = "os_type" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" +checksum = "c3df761f6470298359f84fcfb60d86db02acc22c251c37265c07a3d1057d2389" +dependencies = [ + "regex", +] [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if 1.0.0", - "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -1204,31 +1093,11 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pin-project" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1238,27 +1107,21 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" - -[[package]] -name = "podio" -version = "0.1.7" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18befed8bc2b61abc79a457295e7e838417326da1586050b919414073977f19" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "predicates" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb433456c1a57cc93554dea3ce40b4c19c4057e41c55d4a0f3d84ea71c325aa" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" dependencies = [ "difference", "float-cmp", @@ -1267,20 +1130,31 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" +dependencies = [ + "difflib", + "itertools", + "predicates-core", +] + [[package]] name = "predicates-core" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451" +checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" [[package]] name = "predicates-tree" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f553275e5721409451eb85e15fd9a860a6e5ab4496eb215987502b5f5391f2" +checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" dependencies = [ "predicates-core", - "treeline", + "termtree", ] [[package]] @@ -1307,32 +1181,20 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] @@ -1352,47 +1214,23 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "getrandom 0.1.16", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_chacha", + "rand_core 0.6.3", ] [[package]] name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -1412,38 +1250,11 @@ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" -dependencies = [ - "getrandom 0.2.2", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "rand_core 0.6.2", + "getrandom", ] [[package]] @@ -1457,18 +1268,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.4.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -1477,18 +1288,15 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", -] +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "remove_dir_all" @@ -1501,9 +1309,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.2" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf12057f289428dbf5c591c74bf10392e4a8003f993405a902f20117019022d4" +checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" dependencies = [ "async-compression", "base64", @@ -1511,6 +1319,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", + "h2", "http", "http-body", "hyper", @@ -1524,11 +1333,13 @@ dependencies = [ "pin-project-lite", "rustls", "rustls-native-certs", + "rustls-pemfile 0.3.0", "serde", + "serde_json", "serde_urlencoded", "tokio", "tokio-rustls", - "tokio-util", + "tokio-util 0.6.10", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -1552,12 +1363,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rle-decode-fast" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" - [[package]] name = "rust-ini" version = "0.16.1" @@ -1570,17 +1375,16 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustls" -version = "0.19.0" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ - "base64", "log", "ring", "sct", @@ -1589,21 +1393,39 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.5.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls", + "rustls-pemfile 1.0.0", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +dependencies = [ + "base64", +] + [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "same-file" @@ -1616,12 +1438,12 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -1632,9 +1454,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -1642,9 +1464,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.1.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d493c5f39e02dfb062cd8f33301f90f9b13b650e8c1b1d0fd75c19dd64bff69d" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -1655,9 +1477,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.1.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee48cdde5ed250b0d3252818f646e174ab414036edb884dde62d80a3ac6082d" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -1665,18 +1487,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.124" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.124" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -1685,9 +1507,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "indexmap", "itoa", @@ -1697,9 +1519,9 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", @@ -1709,32 +1531,37 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] +[[package]] +name = "similar" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" + [[package]] name = "slab" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.3.19" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ - "cfg-if 1.0.0", "libc", "winapi 0.3.9", ] @@ -1753,24 +1580,13 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.64" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" dependencies = [ "proc-macro2", "quote", - "unicode-xid", -] - -[[package]] -name = "tar" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0bcfbd6a598361fda270d82469fff3d65089dc33e175c9a131f7b4cd395f228" -dependencies = [ - "filetime", - "libc", - "xattr", + "unicode-ident", ] [[package]] @@ -1785,13 +1601,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.3", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -1799,46 +1615,39 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] -name = "terminal_size" -version = "0.1.16" +name = "termtree" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ca8ced750734db02076f44132d802af0b33b09942331f4459dde8636fd2406" -dependencies = [ - "libc", - "winapi 0.3.9", -] +checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" [[package]] name = "textwrap" -version = "0.12.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" -dependencies = [ - "unicode-width", -] +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -1857,9 +1666,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -1872,29 +1681,29 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.4.0" +version = "1.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" +checksum = "95eec79ea28c00a365f539f1961e9278fbcaf81c0ff6aaf0e93c181352446948" dependencies = [ - "autocfg", "bytes", "libc", "memchr", - "mio 0.7.10", + "mio 0.8.3", "num_cpus", "once_cell", "parking_lot", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", "winapi 0.3.9", ] [[package]] name = "tokio-macros" -version = "1.1.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", @@ -1903,9 +1712,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", "tokio", @@ -1914,9 +1723,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.5" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ "bytes", "futures-core", @@ -1926,20 +1735,34 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-util" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09391a441b373597cf0888d2b052dcf82c5be4fee05da3636ae30fb57aad8484" +checksum = "dbbdcf4f749dd33b1f1ea19b547bf789d87442ec40767d6015e5e2d39158d69a" dependencies = [ "chrono", "combine", @@ -1954,9 +1777,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1965,19 +1788,13 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" dependencies = [ "lazy_static", ] -[[package]] -name = "treeline" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" - [[package]] name = "try-lock" version = "0.2.3" @@ -1985,59 +1802,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "unicase" -version = "2.6.0" +name = "unicode-bidi" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] -name = "unicode-bidi" -version = "0.3.4" +name = "unicode-ident" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - [[package]] name = "untrusted" version = "0.7.1" @@ -2046,9 +1830,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", @@ -2057,28 +1841,25 @@ dependencies = [ ] [[package]] -name = "vcpkg" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" - -[[package]] -name = "vec_map" +name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] [[package]] -name = "version_check" -version = "0.9.3" +name = "vcpkg" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "void" -version = "1.0.2" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wait-timeout" @@ -2091,9 +1872,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi 0.3.9", @@ -2112,33 +1893,31 @@ dependencies = [ [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.72" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if 1.0.0", - "serde", - "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.72" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -2151,9 +1930,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.22" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2163,9 +1942,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.72" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2173,9 +1952,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.72" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -2186,15 +1965,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.72" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.49" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -2202,9 +1981,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ "ring", "untrusted", @@ -2212,9 +1991,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" dependencies = [ "webpki", ] @@ -2262,11 +2041,54 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "winreg" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi 0.3.9", ] @@ -2281,30 +2103,8 @@ dependencies = [ "winapi-build", ] -[[package]] -name = "xattr" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" -dependencies = [ - "libc", -] - [[package]] name = "yansi" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" - -[[package]] -name = "zip" -version = "0.5.6" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58287c28d78507f5f91f2a4cf1e8310e2c76fd4c6932f93ac60fd1ceb402db7d" -dependencies = [ - "bzip2", - "crc32fast", - "flate2", - "podio", - "time", -] +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/Cargo.toml b/Cargo.toml index 642d2de..ae2c16a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,14 +2,15 @@ name = "crom" version = "999.9.9-SNAPSHOT" authors = ["Ethan Hall "] -edition = "2018" +edition = "2021" [dependencies] +human-panic = "1.0.3" log = "0.4" dotenv = "*" async-trait = "0.1" flexi_logger = { version = "0.17", features = ["specfile", "compress"] } -clap = { version = "3.0.0-beta.2" } +clap = { version = "3.1.18", features = ["derive", "env", "cargo"] } error-chain = "0.12" git2 = { version = "0.13", default-features = false } serde = { version = "1", features = ["rc", "derive"] } @@ -17,17 +18,9 @@ toml = "0.5" regex = "1" toml_edit = "0.2" rust-ini = "0.16" -json = "*" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "rustls-tls-native-roots", "gzip"] } -indicatif = "0.15" -mime_guess = "2.0" -mime = "0.3" -url = "2.1" -zip = "0.5" -libflate = "1.0" tempfile = "3.1" tokio = { version = "1", features = ["full"] } -tar = "0.4" serde_json = { version = "1", features = ["preserve_order"] } [dev-dependencies] diff --git a/ci/cache-version b/ci/cache-version new file mode 100644 index 0000000..62eaaf8 --- /dev/null +++ b/ci/cache-version @@ -0,0 +1 @@ +Sun Jun 5 10:57:53 PDT 2022 diff --git a/rust-toolchain b/rust-toolchain index ce92a2d..84c7d0b 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.50.0 \ No newline at end of file +1.61.0 \ No newline at end of file diff --git a/src/cli.rs b/src/cli.rs index bd0480e..a1a9034 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ -use clap::{ArgGroup, Clap}; +use clap::{ArgEnum, ArgGroup, Parser}; use log::LevelFilter; -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] #[clap(group = ArgGroup::new("logging"))] pub struct LoggingOpts { /// A level of verbosity, and can be used multiple times @@ -40,7 +40,7 @@ pub enum VersionRequest { PreRelease, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] #[clap(author, about, version)] pub struct Opts { #[clap(subcommand)] @@ -49,21 +49,18 @@ pub struct Opts { pub logging_opts: LoggingOpts, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub enum SubCommand { Init(InitArgs), Get(GetArgs), - Tag(TagArgs), #[clap(alias = "write")] WriteVersion(WriteArgs), - #[clap(alias = "upload-artifact", alias = "upload")] - UploadArtifacts(UploadArgs), #[clap(name = "util", alias = "utility", alias = "utilities")] Utility(UtilityArgs), } /// Bootstrap a project -#[derive(Clap, Debug)] +#[derive(Parser, ArgEnum, Debug, Clone)] pub enum InitBumper { #[clap(name = "semver")] SemanticVersion, @@ -71,7 +68,7 @@ pub enum InitBumper { } /// Create a .crom.toml file in the working directory. -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct InitArgs { /// What logic should the project use to set versions? #[clap(arg_enum)] @@ -79,13 +76,13 @@ pub struct InitArgs { } /// Retrieve information from the current repo -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct GetArgs { #[clap(subcommand)] pub sub_command: GetSubCommand, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub enum GetSubCommand { /// Get the latest version based on the git history. #[clap(alias = "latest-version")] @@ -123,122 +120,17 @@ impl GetSubCommand { } } -/// Tags the current repo with a new version -#[derive(Clap, Debug)] -pub struct TagArgs { - #[clap(subcommand)] - pub sub_command: TagSubCommand, -} - -#[derive(Clap, Debug)] -pub enum TagSubCommand { - /// Create a tag with custom values. - Custom(TagSubCommandCustomArgs), - - /// Create a pre-release tag. - /// - /// This will be based on the bumper parameters. See [get pre-release] - /// for how the value is computed. - /// - /// This is intended to be used when you publish versions with every build, - /// or branch so that the pre-release version can be used. The general workflow - /// is intended to be `crom tag pre-release`, then if you need to update version - /// number in config (Crom.toml, package.json, etc) run `crom pre-version latest`. - /// If you need to upload artifacts, you can then use `crom upload-artifact pre-release` - PreRelease(TagSubCommandArgs), - - /// Create a tag based on the next version - /// - /// This will be based on the bumper parameters. See [get next-release] - /// for how the value is computed. - /// - /// This is intended to be used when releasing a version. The general workflow - /// is intended to be `crom tag next-release`, then if you need to update version - /// number in config (Crom.toml, package.json, etc) run `crom write-version latest`. - /// If you need to upload artifacts, you can then use `crom upload-artifact latest` - NextRelease(TagSubCommandArgs), -} - -impl TagSubCommand { - pub fn make_version_request(&self) -> VersionRequest { - match self { - TagSubCommand::Custom(args) => VersionRequest::Custom(args.version.clone()), - TagSubCommand::PreRelease(_) => VersionRequest::PreRelease, - TagSubCommand::NextRelease(_) => VersionRequest::NextRelease, - } - } - - pub fn github_token(&self) -> &Option { - match self { - TagSubCommand::NextRelease(args) => &args.github_token, - TagSubCommand::PreRelease(args) => &args.github_token, - TagSubCommand::Custom(args) => &args.github_token, - } - } - - pub fn target_github(&self) -> bool { - match self { - TagSubCommand::NextRelease(args) => args.github, - TagSubCommand::PreRelease(args) => args.github, - TagSubCommand::Custom(args) => args.github, - } - } - - pub fn target_local(&self) -> bool { - match self { - TagSubCommand::NextRelease(args) => args.local, - TagSubCommand::PreRelease(args) => args.local, - TagSubCommand::Custom(args) => args.local, - } - } -} - -#[derive(Clap, Debug)] -#[clap(group = ArgGroup::new("target").required(true).multiple(true))] -pub struct TagSubCommandArgs { - /// Token to be used when talking to GitHub - #[clap(long, env = "GITHUB_TOKEN")] - pub github_token: Option, - - /// Should the tag be created on GitHub - #[clap(short, long, group = "target", requires = "github-token")] - pub github: bool, - - /// Should the tag be created locally? - #[clap(short, long, group = "target")] - pub local: bool, -} - -#[derive(Clap, Debug)] -#[clap(group = ArgGroup::new("target").required(true).multiple(true))] -pub struct TagSubCommandCustomArgs { - /// Token to be used when talking to GitHub - #[clap(long, env = "GITHUB_TOKEN")] - pub github_token: Option, - - /// Should the tag be created on GitHub - #[clap(short, long, group = "target", requires = "github-token")] - pub github: bool, - - /// Should the tag be created locally? - #[clap(short, long, group = "target")] - pub local: bool, - - /// The custom version to be created. - pub version: String, -} - /// Write version into defined sources. /// /// You mush specify the locations that need to be updated in the /// `.crom.toml` file. -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct WriteArgs { #[clap(subcommand)] pub sub_command: WriteSubCommand, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub enum WriteSubCommand { /// Write the latest version /// @@ -272,134 +164,20 @@ impl WriteSubCommand { } } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct WriteSubCommandArgsCustom { /// The custom version to be written. pub version: String, } -/// Upload artifacts to GitHub. -/// -/// You mush specify the artifacts you want to upload. These are defined -/// in `.crom.toml` -#[derive(Clap, Debug)] -pub struct UploadArgs { - #[clap(subcommand)] - pub sub_command: UploadSubCommand, -} - -#[derive(Clap, Debug)] -pub enum UploadSubCommand { - /// Upload a latest version - /// - /// See [get latest] for how the value is computed. - /// - /// You will need to specify which artifacts you want to upload. - Latest(UploadSubCommandArgs), - - /// Update a pre-release version - /// - /// See [get pre-release] for how the value is computed. - /// - /// You will need to specify which artifacts you want to upload. - PreRelease(UploadSubCommandArgs), - - /// Upload a custom version - /// - /// Version is required arg so crom knows what to write. - /// - /// You will need to specify which artifacts you want to upload. - Custom(UploadSubCommandArgsCustom), -} - -impl UploadSubCommand { - pub fn make_version_request(&self) -> VersionRequest { - match self { - UploadSubCommand::Custom(args) => VersionRequest::Custom(args.version.clone()), - UploadSubCommand::PreRelease(_) => VersionRequest::PreRelease, - UploadSubCommand::Latest(_) => VersionRequest::Latest, - } - } - - pub fn github_token(&self) -> String { - match self { - UploadSubCommand::Custom(args) => args.github_token.clone(), - UploadSubCommand::PreRelease(args) => args.github_token.clone(), - UploadSubCommand::Latest(args) => args.github_token.clone(), - } - } - - pub fn artifact_path(&self) -> Option { - match self { - UploadSubCommand::Custom(args) => args.artifact_path.clone(), - UploadSubCommand::PreRelease(args) => args.artifact_path.clone(), - UploadSubCommand::Latest(args) => args.artifact_path.clone(), - } - } - - pub fn artifact_names(&self) -> Vec { - match self { - UploadSubCommand::Custom(args) => args.names.clone(), - UploadSubCommand::PreRelease(args) => args.names.clone(), - UploadSubCommand::Latest(args) => args.names.clone(), - } - } -} - -#[derive(Clap, Debug)] -pub struct UploadSubCommandArgs { - /// Where are the artifacts located? - /// - /// By default, crom will look in your working directory. - /// But most of the time this is wrong, and you should specify - /// the path to search in. - #[clap(long)] - pub artifact_path: Option, - - /// Token to be used when talking to GitHub - #[clap(long, env = "GITHUB_TOKEN")] - pub github_token: String, - - /// The artifacts that need to be uploaded. - /// - /// These names are defined in the `.crom.toml` - #[clap(required = true, min_values = 1)] - pub names: Vec, -} - -#[derive(Clap, Debug)] -pub struct UploadSubCommandArgsCustom { - /// Where are the artifacts located? - /// - /// By default, crom will look in your working directory. - /// But most of the time this is wrong, and you should specify - /// the path to search in. - #[clap(long)] - pub artifact_path: Option, - - /// The custom version to be written. - #[clap(long)] - pub version: String, - - /// Token to be used when talking to GitHub - #[clap(long, env = "GITHUB_TOKEN")] - pub github_token: String, - - /// The artifacts that need to be uploaded. - /// - /// These names are defined in the `.crom.toml` - #[clap(required = true, min_values = 1)] - pub names: Vec, -} - /// Utility that are useful during CI. -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub struct UtilityArgs { #[clap(subcommand)] pub sub_command: UtilitySubCommand, } -#[derive(Clap, Debug)] +#[derive(Parser, Debug)] pub enum UtilitySubCommand { /// Verify repo has no tracked changes /// diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 693c517..6068b64 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -6,8 +6,6 @@ use std::path::PathBuf; mod get; mod init; -mod tag; -mod upload; mod utils; mod write; @@ -37,18 +35,10 @@ pub async fn run_utils(args: crate::cli::UtilityArgs) -> CromResult { utils::UtilsCommand::run_command(args).await } -pub async fn run_tag(args: crate::cli::TagArgs) -> CromResult { - tag::TagCommand::run_command(args).await -} - pub async fn run_write(args: crate::cli::WriteArgs) -> CromResult { write::WriteCommand::run_command(args).await } -pub async fn run_upload(args: crate::cli::UploadArgs) -> CromResult { - upload::UploadCommand::run_command(args).await -} - pub fn are_you_sure(default: bool) -> CromResult { use std::io::Write; @@ -84,7 +74,7 @@ async fn create_version(request: VersionRequest) -> CromResult<(Version, PathBuf let mut head = git_repo::get_head_sha(&repo)?; head.truncate(7); - let version = build_version(request, head, &latest_version); + let version = build_version(request, head, latest_version); Ok((version, location, config)) } diff --git a/src/commands/tag.rs b/src/commands/tag.rs deleted file mode 100644 index 09d1476..0000000 --- a/src/commands/tag.rs +++ /dev/null @@ -1,120 +0,0 @@ -use async_trait::async_trait; -use error_chain::bail; - -use log::{error, info, trace}; - -use crate::cli::TagArgs; -use git2::Repository; -use log::debug; - -use crate::errors::ErrorKind; -use crate::git_repo; -use crate::version::Version; -use crate::CromResult; - -pub struct TagCommand; - -#[async_trait] -impl super::CommandRunner for TagCommand { - async fn run_command(args: TagArgs) -> CromResult { - let (version, location, config) = - super::create_version(args.sub_command.make_version_request()).await?; - let repo = Repository::discover(location)?; - let message = make_message(config.project.message_template, &version); - - if args.sub_command.target_github() { - let github_token = args - .sub_command - .github_token() - .as_ref() - .expect("Clap it, but no github token provided."); - let head = git_repo::get_head_sha(&repo)?; - let remote = git_repo::get_owner_repo_info(&repo)?; - let (owner, repo) = match &remote { - git_repo::RepoRemote::GitHub { owner, repo } => (owner, repo), - }; - tag_github(&head, &owner, &repo, &version, &message, &github_token).await?; - } - - if args.sub_command.target_local() { - tag_local(&repo, &version, &message)?; - info!("Created local tag {}", version); - } - - Ok(0) - } -} - -fn make_message(message_template: Option, version: &Version) -> String { - let template = message_template.unwrap_or_else(|| s!("Crom is creating a version {version}.")); - - template.replace("{version}", &version.to_string()) -} - -pub async fn tag_github( - head: &str, - owner: &str, - repo: &str, - version: &Version, - message: &str, - auth: &str, -) -> CromResult<()> { - use crate::http::*; - - let url = format!( - "{api_server}/repos/{owner}/{repo}/releases", - api_server = get_github_api(), - owner = owner, - repo = repo - ); - - debug!("URL to post to: {}", url); - - let body = json::object! { - "tag_name" => version.to_string(), - "target_commitish" => head, - "name" => version.to_string(), - "body" => message.to_string(), - "draft" => false, - "prerelease" => false - }; - - let body_text = body.dump(); - - let request = make_post(&url, make_github_auth_headers(&auth)?, body_text)?; - - trace!("Request {:?}", &request); - let res = client().execute(request).await.unwrap(); - let status = res.status(); - if !status.is_success() { - let body = match res.text().await { - Ok(body) => body, - Err(err) => { - error!( - "Unable to access response from GitHub. Status was {}", - status - ); - bail!(ErrorKind::GitHubError(err.to_string())) - } - }; - - error!("Response {} from GitHub ({}) was {}", status, url, body); - bail!(ErrorKind::GitHubError(s!("Trouble talking to GitHub"))) - } else { - Ok(()) - } -} - -fn tag_local(repo: &Repository, version: &Version, message: &str) -> CromResult<()> { - use git2::*; - - let head = git_repo::get_head_sha(&repo)?; - let sig = git2::Signature::now("crom", "cli@crom.tech")?; - - let head_obj = repo.find_object(Oid::from_str(&head)?, Some(ObjectType::Commit))?; - - match repo.tag(&format!("{}", version), &head_obj, &sig, message, false) { - Ok(_) => Ok(()), - Err(e) => bail!(ErrorKind::UnableToTag(e.to_string())), - } -} diff --git a/src/commands/upload/compress.rs b/src/commands/upload/compress.rs deleted file mode 100644 index 5e87ccc..0000000 --- a/src/commands/upload/compress.rs +++ /dev/null @@ -1,93 +0,0 @@ -use error_chain::bail; -use log::debug; -use std::collections::HashMap; -use std::fs::File; -use std::io::prelude::*; -use std::path::{Path, PathBuf}; - -use libflate::gzip::Encoder; -use std::io::Write; -use tar::Builder as TarBuilder; -use tempfile::NamedTempFile; - -use crate::errors::ErrorKind; -use crate::models::*; -use crate::CromResult; - -pub fn compress_files( - output_file: &NamedTempFile, - root_path: PathBuf, - artifacts: &HashMap, - format: &ProjectArtifactCompressionFormat, -) -> CromResult<()> { - debug!("Compressing {:?} into {:?}", root_path, output_file); - match format { - ProjectArtifactCompressionFormat::ZIP => zip(output_file, root_path, artifacts), - ProjectArtifactCompressionFormat::TGZ => tgz(output_file, root_path, artifacts), - } -} - -fn zip( - output_file: &NamedTempFile, - root_path: PathBuf, - artifacts: &HashMap, -) -> CromResult<()> { - let mut zip = zip::ZipWriter::new(output_file); - - for (name, path) in artifacts { - debug!("Compressing {} located at {}", name, path); - let name = name.to_string(); - let options = - zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored); - if let Err(e) = zip.start_file(name.clone(), options) { - bail!(ErrorKind::CompressionError(format!( - "Invalid Artifact Name: Error {:?}", - e - ))); - } - - let mut art_path = root_path.clone(); - art_path.push(Path::new(path)); - - if !art_path.exists() { - bail!(ErrorKind::CompressionError(format!( - "Unable to find artifact at {}", - art_path.to_str().unwrap().to_string() - ))) - } - - let mut file = File::open(art_path)?; - let mut contents: Vec = Vec::new(); - file.read_to_end(&mut contents)?; - - zip.write_all(&contents)?; - } - - // Optionally finish the zip. (this is also done on drop) - zip.finish()?; - - Ok(()) -} - -fn tgz( - output_file: &NamedTempFile, - root_path: PathBuf, - artifacts: &HashMap, -) -> CromResult<()> { - let mut ar = TarBuilder::new(Vec::new()); - - for (name, path) in artifacts { - let mut art_path = root_path.clone(); - art_path.push(path); - - let mut f = File::open(art_path)?; - ar.append_file(name, &mut f)?; - } - - let mut encoder = Encoder::new(output_file)?; - let data = ar.into_inner()?; - encoder.write_all(&data)?; - encoder.finish().into_result()?; - - Ok(()) -} diff --git a/src/commands/upload/github.rs b/src/commands/upload/github.rs deleted file mode 100644 index b35b392..0000000 --- a/src/commands/upload/github.rs +++ /dev/null @@ -1,159 +0,0 @@ -use error_chain::bail; -use std::collections::HashMap; -use std::path::PathBuf; - -use json::{self, JsonValue}; -use reqwest::{Request, Response}; -use url::Url; - -use log::{debug, error, log_enabled, trace}; - -use crate::errors::ErrorKind; -use crate::http::*; -use crate::models::*; -use crate::version::Version; -use crate::CromResult; - -use super::ArtifactContainer; - -pub struct GithubClient { - auth: String, - owner: String, - repo: String, -} - -impl<'a> GithubClient { - pub fn new(owner: &str, repo: &str, auth: &str) -> Self { - GithubClient { - auth: auth.to_string(), - owner: owner.to_string(), - repo: repo.to_string(), - } - } - - pub async fn make_upload_request( - &self, - version: &Version, - artifacts: ProjectArtifacts, - root_path: PathBuf, - ) -> CromResult> { - let release_url = format!( - "{api}/repos/{owner}/{repo}/releases/tags/{version}", - api = get_github_api(), - owner = self.owner, - repo = self.repo, - version = version - ); - - debug!("Release URL: {}", release_url); - - let request = make_get_request(&release_url, make_github_auth_headers(&self.auth)?)?; - let res = client().execute(request).await.unwrap(); - let upload_url = extract_upload_url(res).await?; - - match artifacts.compress { - Some(compression) => { - self.compress_artifact(&upload_url, root_path, &artifacts.paths, &compression) - } - None => self.build_artifact_containers(&upload_url, root_path, &artifacts.paths), - } - } - - fn compress_artifact( - &self, - upload_url: &Url, - root_path: PathBuf, - artifacts: &HashMap, - compresion: &ProjectArtifactWrapper, - ) -> CromResult> { - let compressed_name = compresion.name.to_string(); - let file = tempfile::NamedTempFile::new()?; - - super::compress::compress_files(&file, root_path, &artifacts, &compresion.format)?; - let request = - self.build_request(upload_url, &compressed_name, file.path().to_path_buf())?; - file.close()?; - - let container = ArtifactContainer::new(request, compressed_name); - Ok(vec![container]) - } - - fn build_artifact_containers( - &self, - upload_url: &Url, - root_path: PathBuf, - artifacts: &HashMap, - ) -> CromResult> { - let mut upload_requests = Vec::new(); - - for (name, art_path) in artifacts { - let mut path = root_path.clone(); - path.push(art_path); - - let request = self.build_request(upload_url, &name, path)?; - upload_requests.push(ArtifactContainer::new(request, name.to_string())); - } - - Ok(upload_requests) - } - - fn build_request( - &self, - upload_url: &Url, - file_name: &str, - file: PathBuf, - ) -> CromResult { - let mut uri = upload_url.clone(); - { - let mut path = uri.path_segments_mut().expect("Cannot get path"); - path.pop(); - path.push("assets"); - } - - { - let mut query = uri.query_pairs_mut(); - query.clear(); - query.append_pair("name", file_name); - } - - make_file_upload_request(&uri, file, make_github_auth_headers(&self.auth)?) - } -} - -async fn extract_upload_url(res: Response) -> CromResult { - let body_text = match res.text().await { - Ok(text) => text, - Err(err) => { - error!("Unable to access response from GitHub."); - bail!(ErrorKind::GitHubError(err.to_string(),)) - } - }; - - let json_body = match json::parse(&body_text) { - Ok(value) => value, - Err(err) => { - debug!("Body was: {}", body_text); - bail!(ErrorKind::GitHubError(err.to_string().to_lowercase(),)) - } - }; - - let obj = match json_body { - JsonValue::Object(obj) => obj, - _ => { - error!("GitHub gave back a strange type."); - bail!(ErrorKind::GitHubError(s!( - "GitHub gave back a strange type." - ),)) - } - }; - - if log_enabled!(log::Level::Trace) { - trace!("Json Response: {}", obj.dump()); - } - - let upload_url = obj.get("upload_url").unwrap().as_str().unwrap(); - match Url::parse(upload_url) { - Ok(it) => Ok(it), - Err(e) => bail!(ErrorKind::GitHubError(e.to_string(),)), - } -} diff --git a/src/commands/upload/mod.rs b/src/commands/upload/mod.rs deleted file mode 100644 index 5d54170..0000000 --- a/src/commands/upload/mod.rs +++ /dev/null @@ -1,162 +0,0 @@ -use async_trait::async_trait; -use error_chain::bail; -use log::{debug, error, log_enabled, trace}; -use std::path::PathBuf; - -use git2::Repository; -use indicatif::{ProgressBar, ProgressStyle}; -use reqwest::Request; - -mod compress; -mod github; - -use crate::cli::UploadArgs; -use crate::errors::ErrorKind; -use crate::git_repo; -use crate::models::*; -use crate::version::Version; -use crate::CromResult; - -pub struct UploadCommand; - -#[async_trait] -impl super::CommandRunner for UploadCommand { - async fn run_command(args: UploadArgs) -> CromResult { - let (version, location, config) = - super::create_version(args.sub_command.make_version_request()).await?; - let repo = Repository::discover(location.clone())?; - let remote = git_repo::get_owner_repo_info(&repo)?; - let (owner, repo) = match &remote { - git_repo::RepoRemote::GitHub { owner, repo } => (owner, repo), - }; - - let artifact_path = args - .sub_command - .artifact_path() - .map(PathBuf::from) - .unwrap_or(location); - let mut artifacts: Vec = Vec::new(); - - for name in args.sub_command.artifact_names() { - match config.artifact.get(&name) { - Some(artifact) => artifacts.push(artifact.clone()), - None => { - error!("Could not find artifact {} in .crom.toml", &name); - bail!(ErrorKind::ArtifactMissing(name.to_string())) - } - } - } - - upload_artifacts( - &owner, - &repo, - &version, - artifacts, - artifact_path, - args.sub_command.github_token(), - ) - .await?; - Ok(0) - } -} - -#[derive(Debug)] -pub struct ArtifactContainer { - request: Request, - name: String, -} - -impl ArtifactContainer { - fn new(request: Request, name: String) -> Self { - ArtifactContainer { request, name } - } -} - -async fn upload_artifacts( - owner: &str, - repo: &str, - version: &Version, - artifacts: Vec, - root_artifact_path: PathBuf, - auth: String, -) -> CromResult<()> { - let mut upload_requests: Vec = Vec::new(); - - for art in artifacts { - let res = match art.target { - ProjectArtifactTarget::GitHub => { - let client = github::GithubClient::new(&owner, &repo, &auth); - client - .make_upload_request(version, art, root_artifact_path.clone()) - .await - } - }; - - match res { - Err(e) => { - error!("Error while building upload request: {:?}", e); - bail!(ErrorKind::GitHubError("Upload Failed".to_string())) - } - Ok(bodys) => upload_requests.extend(bodys), - } - } - - do_request(upload_requests).await -} - -async fn do_request(requests: Vec) -> CromResult<()> { - let spinner = ProgressBar::new(requests.len() as u64); - spinner.set_style( - ProgressStyle::default_spinner() - .tick_chars("/|\\- ") - .template("{spinner:.dim.bold} [{pos:>7}/{len:7}] Processing request to {wide_msg}"), - ); - - if !log_enabled!(log::Level::Trace) { - spinner.enable_steady_tick(100); - } - - for request in requests { - if let Err(e) = do_transfer(request).await { - spinner.finish_and_clear(); - return Err(e); - } - spinner.inc(1); - } - - spinner.finish_and_clear(); - - Ok(()) -} - -async fn do_transfer(container: ArtifactContainer) -> CromResult<()> { - trace!("Request: {:?}", container); - - let res = match crate::http::client().execute(container.request).await { - Ok(res) => res, - Err(err) => { - let err_string = err.to_string(); - debug!("Hyper error: {:?}", err); - error!("Failed to make request for {}", container.name); - bail!(ErrorKind::GitHubError(format!( - "Unknown communication error when talking to GitHub: Error {}", - err_string, - ))) - } - }; - - let status = res.status(); - if !status.is_success() { - if let Ok(body_text) = res.text().await { - debug!("Failed Upload: {}", body_text); - } - - error!("Failed to upload to {}", container.name); - bail!(ErrorKind::GitHubError(format!( - "Failed Upload to {}", - container.name - ))); - } - - Ok(()) -} diff --git a/src/errors.rs b/src/errors.rs index 4c2e910..740a7f3 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -11,7 +11,6 @@ error_chain! { Json(::serde_json::Error); Ini(::ini::ParseError); StringUtf8Error(::std::string::FromUtf8Error); - Zip(::zip::result::ZipError); } errors { diff --git a/src/git_repo.rs b/src/git_repo.rs index 9c143bd..aec8437 100644 --- a/src/git_repo.rs +++ b/src/git_repo.rs @@ -1,20 +1,12 @@ +use git2::*; use log::debug; use std::vec::Vec; -use error_chain::bail; -use git2::*; -use regex::Regex; - -use crate::errors::{Error as CromError, ErrorKind}; +use crate::errors::Error as CromError; use crate::version::{Version, VersionMatcher}; type Result = std::result::Result; -#[derive(Debug)] -pub enum RepoRemote { - GitHub { owner: String, repo: String }, -} - pub fn get_tags(repo: &Repository, matcher: &VersionMatcher) -> Result> { let tags = repo.tag_names(None)?; let mut tags: Vec = tags @@ -47,50 +39,3 @@ pub fn get_head_sha(repo: &Repository) -> Result { .collect(); Ok(strs.join("")) } - -pub fn get_owner_repo_info(repo: &Repository) -> Result { - let config = repo.config()?; - - let remote = config.get_string("remote.origin.url")?; - - parse_remote(&remote) -} - -fn parse_remote(remote: &str) -> Result { - let re = - Regex::new("^(https://github.com/|git@github.com:)(?P.+?)/(?P.+?)(\\.git)?$")?; - - match re.captures(remote) { - Some(matches) => { - let owner = matches.name("owner").unwrap().as_str().to_string(); - let repo = matches.name("repo").unwrap().as_str().to_string(); - - Ok(RepoRemote::GitHub { owner, repo }) - } - None => bail!(ErrorKind::UnknownGitRemotes(remote.to_string())), - } -} - -#[test] -fn test_parse_remote_https() { - let https = parse_remote("https://github.com/ethankhall/crom"); - match https { - Ok(RepoRemote::GitHub { owner, repo }) => { - assert_eq!("ethankhall", owner); - assert_eq!("crom", repo); - } - Err(_) => unreachable!(), - }; -} - -#[test] -fn test_parse_remote_git() { - let https = parse_remote("git@github.com:ethankhall/crom.git"); - match https { - Ok(RepoRemote::GitHub { owner, repo }) => { - assert_eq!("ethankhall", owner); - assert_eq!("crom", repo); - } - Err(_) => unreachable!(), - }; -} diff --git a/src/http.rs b/src/http.rs deleted file mode 100644 index 35ffca0..0000000 --- a/src/http.rs +++ /dev/null @@ -1,136 +0,0 @@ -use error_chain::bail; -use log::debug; -use std::collections::HashMap; -use std::fs::File; -use std::io::Read; -use std::path::PathBuf; -use std::str::FromStr; - -#[cfg(test)] -use log::warn; - -use crate::errors::ErrorKind; -use crate::CromResult; - -use reqwest::header::{HeaderMap, HeaderName, HeaderValue, ACCEPT, CONTENT_TYPE, USER_AGENT}; -use reqwest::Request; - -use mime_guess::from_path; -use url::Url; - -pub fn make_file_upload_request( - url: &Url, - file_path: PathBuf, - headers: HashMap, -) -> CromResult { - debug!("Upload url {}", url); - - let mime = from_path(&file_path).first_or_octet_stream(); - - if !file_path.exists() { - bail!(ErrorKind::FileNotFound(file_path)); - } - let mut buffer = Vec::new(); - let mut file = File::open(file_path)?; - file.read_to_end(&mut buffer)?; - - let header_map = build_headers(headers)?; - - Ok(client() - .post(url.as_str()) - .header(USER_AGENT, format!("crom/{}", env!("CARGO_PKG_VERSION"))) - .header(CONTENT_TYPE, mime.to_string()) - .headers(header_map) - .body(buffer) - .build() - .unwrap()) -} - -pub fn make_get_request(url: &str, headers: HashMap) -> CromResult { - let header_map = build_headers(headers)?; - - Ok(client() - .get(url) - .header(USER_AGENT, format!("crom/{}", env!("CARGO_PKG_VERSION"))) - .header(ACCEPT, "application/vnd.github.v3+json") - .headers(header_map) - .build() - .unwrap()) -} - -pub fn make_post( - url: &str, - headers: HashMap, - body_content: String, -) -> CromResult { - let header_map = build_headers(headers)?; - - Ok(client() - .post(url) - .header(USER_AGENT, format!("crom/{}", env!("CARGO_PKG_VERSION"))) - .header(ACCEPT, "application/vnd.github.v3+json") - .headers(header_map) - .body(body_content) - .build() - .unwrap()) -} - -fn build_headers(headers: HashMap) -> CromResult { - let mut header_map = HeaderMap::new(); - for (key, value) in headers { - let value = match HeaderValue::from_str(&value) { - Ok(value) => value, - Err(e) => bail!(ErrorKind::HeaderError(e.to_string())), - }; - let key = match HeaderName::from_str(&key) { - Ok(key) => key, - Err(e) => bail!(ErrorKind::HeaderError(e.to_string())), - }; - - header_map.insert(key, value); - } - - Ok(header_map) -} - -pub fn client() -> reqwest::Client { - reqwest::Client::builder() - .gzip(true) - .timeout(std::time::Duration::from_secs(10)) - .build() - .unwrap() -} - -#[cfg(test)] -pub fn make_github_auth_headers(_auth: &str) -> CromResult> { - warn!("Using debug GITHUB headers!"); - Ok(HashMap::new()) -} - -#[cfg(not(test))] -pub fn make_github_auth_headers(auth: &str) -> CromResult> { - use reqwest::header::AUTHORIZATION; - - let token = format!("bearer {}", auth); - - let mut map: HashMap = HashMap::new(); - let auth_header = AUTHORIZATION; - map.insert(auth_header.to_string(), token); - - Ok(map) -} - -#[cfg(not(test))] -pub fn get_github_api() -> String { - use std::env; - - match env::var("GITHUB_API_SERVER") { - Ok(value) => value, - Err(_) => s!("https://api.github.com"), - } -} - -#[cfg(test)] -pub fn get_github_api() -> String { - mockito::server_url() -} diff --git a/src/main.rs b/src/main.rs index d14d8b3..edf573d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,14 +13,14 @@ mod cli; mod commands; mod errors; mod git_repo; -mod http; mod logging; mod models; mod statics; mod version; -use clap::Clap; +use clap::Parser; use dotenv::dotenv; +use human_panic::setup_panic; use log::error; use std::process; @@ -30,6 +30,7 @@ use crate::cli::*; #[tokio::main] async fn main() { + setup_panic!(); dotenv().ok(); let opt = Opts::parse(); @@ -39,9 +40,7 @@ async fn main() { let result: CromResult = match opt.sub_command { SubCommand::Init(args) => crate::commands::run_init(args).await, SubCommand::Get(args) => crate::commands::run_get(args).await, - SubCommand::Tag(args) => crate::commands::run_tag(args).await, SubCommand::WriteVersion(args) => crate::commands::run_write(args).await, - SubCommand::UploadArtifacts(args) => crate::commands::run_upload(args).await, SubCommand::Utility(args) => crate::commands::run_utils(args).await, }; diff --git a/src/models/user_config.rs b/src/models/user_config.rs index d9c0b07..e5bdda4 100644 --- a/src/models/user_config.rs +++ b/src/models/user_config.rs @@ -89,9 +89,9 @@ fn default_propery_file_path() -> String { #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub enum ProjectArtifactCompressionFormat { #[serde(alias = "zip", alias = "ZIP")] - ZIP, - #[serde(alias = "tgz", alias = "tar.gz")] - TGZ, + Zip, + #[serde(alias = "tgz", alias = "TGZ", alias = "tar.gz")] + Tgz, } #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] @@ -129,7 +129,7 @@ path = \"path/to/version.py\" path = \"path/to/property-file.properties\" "; - let config = toml::from_str::(&example_text).unwrap(); + let config = toml::from_str::(example_text).unwrap(); println!("config: {:?}", config); assert_eq!(Some(CargoConfig { directory: None }), config.project.cargo); assert_eq!(Some(MavenConfig {}), config.project.maven); diff --git a/src/version/version_impl.rs b/src/version/version_impl.rs index aa939a8..df92b0a 100644 --- a/src/version/version_impl.rs +++ b/src/version/version_impl.rs @@ -13,7 +13,7 @@ impl Ord for Version { let other_part = &other.parts[i]; let self_part = &self.parts[i]; - match other_part.cmp(&self_part) { + match other_part.cmp(self_part) { Ordering::Equal => continue, Ordering::Less => return Ordering::Greater, Ordering::Greater => return Ordering::Less, diff --git a/src/version/version_parser.rs b/src/version/version_parser.rs index d4abc5b..370676c 100644 --- a/src/version/version_parser.rs +++ b/src/version/version_parser.rs @@ -2,7 +2,7 @@ use super::*; impl VersionMatcher { pub fn new(pattern: &str) -> Self { - let split: Vec<&str> = pattern.split('.').collect(); + let split = pattern.split('.'); let parts: Vec = split .into_iter() .map(|x| match x { diff --git a/tests/crom-tag.rs b/tests/crom-tag.rs deleted file mode 100644 index 0852787..0000000 --- a/tests/crom-tag.rs +++ /dev/null @@ -1,62 +0,0 @@ -extern crate assert_cmd; -extern crate mockito; -extern crate predicates; - -mod lib; - -use std::process::Command; - -use assert_cmd::prelude::*; -use mockito::mock; -use predicates::prelude::*; -use tempdir::TempDir; - -#[cfg(unix)] -#[tokio::test] -async fn can_tag_version() { - let mock = mock("POST", "/repos/ethankhall/crom-examples/releases") - .match_header("accept", "application/vnd.github.v3+json") - .match_header("authorization", "bearer ABC123") - .with_status(201) - .with_body("{\"test\": true}") - .create(); - - let tmp_dir = TempDir::new("test-dir").expect("temp dir should be created"); - let tmp_dir = tmp_dir.path().to_owned(); - lib::checkout_repo(tmp_dir.clone()); - - let mut builder = tmp_dir.to_path_buf(); - builder.push("example-1"); - - println!("Finished clone"); - - let mut cmd = Command::cargo_bin("crom").unwrap(); - let assert = cmd - .arg("tag") - .arg("next-release") - .arg("--github") - .arg("--local") - .arg("-vvvv") - .env("GITHUB_API_SERVER", mockito::server_url()) - .env("GITHUB_TOKEN", "ABC123") - .current_dir(builder.clone()) - .assert(); - - println!( - "{}", - std::str::from_utf8(&assert.success().get_output().stdout).unwrap() - ); - - mock.assert(); - - let mut cmd = Command::cargo_bin("crom").unwrap(); - let assert = cmd - .arg("get") - .arg("latest") - .current_dir(builder.clone()) - .assert(); - - assert - .success() - .stdout(predicate::str::similar(format!("{}\n", lib::NEXT_VERSION))); -}