From 0a99b7a766c8f453656fc47b0a971f0952cdcfd0 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 12 Nov 2025 09:12:52 +0900 Subject: [PATCH 1/5] style: Normalize Cargo.toml include array formatting --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de15b19..ea91efa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,10 @@ categories = ["compression", "no-std"] license = "MIT" edition = "2021" include = [ - 'Cargo.toml', - 'README.md', - 'LICENSE', - 'src/**/*.rs', + "Cargo.toml", + "README.md", + "LICENSE", + "src/**/*.rs", ] [dependencies] From 833cb92f6bb96d0177238c211c42cc9b4ad2f5a1 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 12 Nov 2025 09:22:04 +0900 Subject: [PATCH 2/5] chore: Update CI workflow to use latest action versions and simplify cargo commands --- .github/workflows/ci.yml | 43 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4c5364..4ecb554 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: features: [--no-default-features, --all-features] steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v5 - name: Install ${{ matrix.toolchain }} toolchain run: | @@ -20,17 +20,14 @@ jobs: rustup default ${{ matrix.toolchain }} - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: ${{ matrix.features }} --workspace + run: cargo check ${{ matrix.features }} --workspace no-std: name: no_std Check runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v5 - name: Install nightly toolchain run: | @@ -38,24 +35,15 @@ jobs: rustup default nightly - name: Install cargo no-std-check - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-no-std-check + run: cargo install cargo-no-std-check # https://github.com/mystor/cargo-no-std-check/issues/2 # `--no-default-features` doesn't work with `--workspace` correctly. - name: Run cargo no-std-check on libflate crate - uses: actions-rs/cargo@v1 - with: - command: no-std-check - args: --no-default-features + run: cargo no-std-check --no-default-features - name: Run cargo no-std-check on libflate_lz77 crate - uses: actions-rs/cargo@v1 - with: - command: no-std-check - args: --no-default-features --manifest-path libflate_lz77/Cargo.toml + run: cargo no-std-check --no-default-features --manifest-path libflate_lz77/Cargo.toml test: name: Test Suite @@ -66,7 +54,7 @@ jobs: features: [--no-default-features, --all-features] steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v5 - name: Install ${{ matrix.toolchain }} toolchain run: | @@ -74,10 +62,7 @@ jobs: rustup default ${{ matrix.toolchain }} - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: ${{ matrix.features }} --workspace + run: cargo test ${{ matrix.features }} --workspace lints: name: Lints @@ -88,7 +73,7 @@ jobs: features: [--no-default-features, --all-features] steps: - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v5 - name: Install ${{ matrix.toolchain }} toolchain run: | @@ -97,14 +82,8 @@ jobs: rustup component add rustfmt clippy - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: Run cargo clippy if: matrix.toolchain != 'beta' - uses: actions-rs/cargo@v1 - with: - command: clippy - args: ${{ matrix.features }} --workspace -- -D warnings + run: cargo clippy ${{ matrix.features }} --workspace -- -D warnings From 9595ae9755d072dbaa12c75181cfd23c595bc1c6 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 12 Nov 2025 09:22:44 +0900 Subject: [PATCH 3/5] chore: Add GitHub release and crates.io publish workflow --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bd19920 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Create GitHub Release and Publish to crates.io + +on: + push: + tags: ['v*'] + +jobs: + github-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v5 + + - id: create-release + run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + runs-on: ubuntu-latest + # environment: release # Optional: for enhanced security + permissions: + id-token: write + steps: + - uses: actions/checkout@v5 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} From ff4285942bdb01eea477a8a87dd1e4803dfae8da Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 12 Nov 2025 09:31:02 +0900 Subject: [PATCH 4/5] chore: Fix indentation in release workflow --- .github/workflows/release.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd19920..a9c745c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,6 @@ jobs: contents: write steps: - uses: actions/checkout@v5 - - id: create-release run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes env: @@ -23,9 +22,9 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v5 - - uses: rust-lang/crates-io-auth-action@v1 - id: auth - - run: cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + - uses: actions/checkout@v5 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} From b0eb13070860a0e5f16ba8d55b1d912460384712 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 12 Nov 2025 09:31:47 +0900 Subject: [PATCH 5/5] chore: Add dependency on github-release job to publish workflow --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9c745c..feef18c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish: + needs: github-release runs-on: ubuntu-latest # environment: release # Optional: for enhanced security permissions: