From add01a52c69d8969b7c7f8dfb13c44a341ec3fb7 Mon Sep 17 00:00:00 2001 From: fan-tastic-z Date: Tue, 6 Aug 2024 14:18:41 +0800 Subject: [PATCH] feat: update github action and cargo-generate config --- .github/workflows/build.yml | 7 +++++++ cargo-generate.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb95232..96dba95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,13 @@ jobs: - name: install nextest uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 + - name: Get repository name + id: repo_name + run: | + echo "::set-output name=name::$(basename $GITHUB_REPOSITORY)" + - name: Replace package name in Cargo.toml + run: | + sed -i "s/{{project-name}}/${{ steps.repo_name.outputs.name }}/g" Cargo.toml - name: Check code format run: cargo fmt -- --check - name: Check the package for errors diff --git a/cargo-generate.toml b/cargo-generate.toml index 5db310f..b3e4e36 100644 --- a/cargo-generate.toml +++ b/cargo-generate.toml @@ -1,3 +1,3 @@ [template] ignore = ["cargo-generate.toml"] -cargo_generate_version = ">=0.21.0" +include = ["Cargo.toml", "cliff.toml"]