diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 60ab683..f8996ba 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,12 @@ updates: # default location of `.github/workflows` directory: "/" schedule: - interval: "daily" + interval: "monthly" + cooldown: + default-days: 7 - package-ecosystem: "cargo" directory: "/" schedule: - interval: "daily" + interval: "monthly" + cooldown: + default-days: 7 diff --git a/.github/workflows/ci-clippy.yml b/.github/workflows/ci-clippy.yml index 7a8ac47..4fc32ab 100644 --- a/.github/workflows/ci-clippy.yml +++ b/.github/workflows/ci-clippy.yml @@ -2,19 +2,24 @@ name: clippy (Linux) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +permissions: {} + jobs: build: + permissions: {} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run clippy - run: cargo clippy --all-features -- -D clippy::all \ No newline at end of file + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - name: Run clippy + run: cargo clippy --all-features -- -D clippy::all diff --git a/.github/workflows/ci-fmt.yml b/.github/workflows/ci-fmt.yml index 0065452..abf08ec 100644 --- a/.github/workflows/ci-fmt.yml +++ b/.github/workflows/ci-fmt.yml @@ -2,19 +2,24 @@ name: rustfmt (Linux) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +permissions: {} + jobs: build: + permissions: {} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run rustfmt - run: cargo fmt --check \ No newline at end of file + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - name: Run rustfmt + run: cargo fmt --check diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 6d81998..480d47c 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -2,50 +2,50 @@ name: Test (Linux) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +permissions: {} + jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Test [no features] - run: cargo test --verbose + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - - name: Test ['chrono' feature] - run: cargo test --verbose --features chrono + - name: Test [no features] + run: cargo test --verbose - - name: Test ['tokio' feature] - run: cargo test --verbose --features tokio + - name: Test ['tokio' feature] + run: cargo test --verbose --features tokio - - name: Test ['tokio-fs' feature] - run: cargo test --verbose --features tokio-fs + - name: Test ['tokio-fs' feature] + run: cargo test --verbose --features tokio-fs - - name: Test ['deflate' feature] - run: cargo test --verbose --features deflate + - name: Test ['deflate' feature] + run: cargo test --verbose --features deflate - - name: Test ['bzip2' feature] - run: cargo test --verbose --features bzip2 + - name: Test ['bzip2' feature] + run: cargo test --verbose --features bzip2 - - name: Test ['lzma' feature] - run: cargo test --verbose --features lzma + - name: Test ['lzma' feature] + run: cargo test --verbose --features lzma - - name: Test ['zstd' feature] - run: cargo test --verbose --features zstd + - name: Test ['zstd' feature] + run: cargo test --verbose --features zstd - - name: Test ['xz' feature] - run: cargo test --verbose --features xz + - name: Test ['xz' feature] + run: cargo test --verbose --features xz - - name: Test ['deflate64' feature] - run: cargo test --verbose --features deflate64 + - name: Test ['deflate64' feature] + run: cargo test --verbose --features deflate64 - - name: Test ['full' feature] - run: cargo test --verbose --features full + - name: Test ['full' feature] + run: cargo test --verbose --features full diff --git a/.github/workflows/ci-typos.yml b/.github/workflows/ci-typos.yml index 8ab902e..e768fa2 100644 --- a/.github/workflows/ci-typos.yml +++ b/.github/workflows/ci-typos.yml @@ -2,23 +2,28 @@ name: typos (Linux) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +permissions: {} + jobs: build: + permissions: {} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - - name: Install typos - run: cargo install typos-cli + - name: Install typos + run: cargo install typos-cli - - name: Run typos - run: typos --format brief \ No newline at end of file + - name: Run typos + run: typos --format brief diff --git a/.github/workflows/ci-wasm.yml b/.github/workflows/ci-wasm.yml index 3214a73..6c83e58 100644 --- a/.github/workflows/ci-wasm.yml +++ b/.github/workflows/ci-wasm.yml @@ -2,23 +2,27 @@ name: Build (WASM) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always +permissions: {} + jobs: build: + permissions: {} name: Build ['full-wasm' feature] on ${{ matrix.target }} runs-on: ubuntu-latest strategy: matrix: target: - - wasm32-wasi - wasm32-unknown-unknown steps: - - uses: actions/checkout@v4 - - run: rustup target add ${{ matrix.target }} - - run: cargo build --verbose --target ${{ matrix.target }} --features full-wasm + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - run: rustup target add ${{ matrix.target }} + - run: cargo build --verbose --target ${{ matrix.target }} --features full-wasm diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b591f5f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to crates.io + +on: + push: + tags: + - "v*" + +env: + CARGO_TERM_COLOR: always + +permissions: {} + +jobs: + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + environment: + name: crates-io + + permissions: + id-token: write # for Trusted Publishing to crates.io + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 + id: auth + + - name: Publish to crates.io + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: "${{ steps.auth.outputs.token }}" diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..7e9a92c --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,24 @@ +name: GitHub Actions Security Analysis with zizmor + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-latest + permissions: + security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 diff --git a/Cargo.toml b/Cargo.toml index afdabef..0b294a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astral_async_zip" -version = "0.0.17" +version = "0.0.18-rc1" edition = "2021" authors = ["Harry [hello@majored.pw]"] repository = "https://github.com/astral-sh/rs-async-zip" @@ -38,11 +38,15 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] crc32fast = "1" -futures-lite = { version = "2.1.0", default-features = false, features = ["std"] } +futures-lite = { version = "2.1.0", default-features = false, features = [ + "std", +] } pin-project = "1" thiserror = "2.0.18" -async-compression = { version = "0.4.2", default-features = false, features = ["futures-io"], optional = true } +async-compression = { version = "0.4.2", default-features = false, features = [ + "futures-io", +], optional = true } tokio = { version = "1", default-features = false, optional = true } tokio-util = { version = "0.7", features = ["compat"], optional = true } diff --git a/src/lib.rs b/src/lib.rs index dc8256b..10c7f62 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,6 @@ //! ### Feature Flags //! - `full` - Enables all below features. //! - `full-wasm` - Enables all below features that are compatible with WASM. -//! - `chrono` - Enables support for parsing dates via `chrono`. //! - `tokio` - Enables support for the `tokio` implementation module. //! - `tokio-fs` - Enables support for the `tokio::fs` reading module. //! - `deflate` - Enables support for the Deflate compression method.