From 2e916994b59857ed1981dc94016a2c41a47da721 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:40:12 +0100 Subject: [PATCH 1/6] [ci/cd] github cd workflow with cargo publish --- .github/workflows/cd.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..d244265 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,30 @@ +name: CD + +on: + release: + types: [ published ] + +jobs: + deploy: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + rust: [ stable ] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - name: + uses: actions-rs/cargo@v1 + with: + command: check + - name: Publish + run: cargo publish --token ${CRATES_TOKEN} + env: + CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} From cb4b2fdcada140c4bf24682ca3eded5680cbfec7 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:40:53 +0100 Subject: [PATCH 2/6] =?UTF-8?q?[build]=20bump=20to=20major=20version=20v0.?= =?UTF-8?q?1.1=20=E2=86=92=20v1.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2211d1d..fe3f4a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "padder" -version = "0.1.1" +version = "1.0.0" edition = "2021" -description = "Efficient data formatting and padding, done right, the rusty way." +description = "Highly efficient data and string formatting library for Rust." authors = [ "Wilhelm Ă…gren ", ] From 52e0bff4c2ad10f2121d56d45ce3c29c565d6b8f Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:41:12 +0100 Subject: [PATCH 3/6] [fix] syntax error in example docs --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index e1759d3..1b90251 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ * Last updated: 2023-12-19 */ +/// /// Highly efficient data and string formatting library for Rust. /// /// Pad and format string slices and generic vectors efficiently with minimal memory @@ -41,9 +42,11 @@ /// +---+---+---+ +---+---+---+---+---+---+ /// /// ``` +/// use padder::*; /// let output: String = "abc".pad(6, Alignment::Left, Symbol::Whitespace); /// ``` /// + use std::clone; /// Exhaustive enum for the alternative ways to pad and format data. From 118747a110ea82f50deff8d44933ca7a1a84faf4 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:43:29 +0100 Subject: [PATCH 4/6] [fix] missing name on cd step --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d244265..1cbf2bf 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,11 +20,11 @@ jobs: profile: minimal toolchain: ${{ matrix.rust }} override: true - - name: + - name: Cargo check uses: actions-rs/cargo@v1 with: command: check - - name: Publish + - name: Cargo publish run: cargo publish --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} From 3d08f23f51cf2541bb1b9dae8b4e1a5b9e0ab3fd Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:45:49 +0100 Subject: [PATCH 5/6] [fix] cargo fmt and clippy lint changes --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1b90251..de7a407 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,7 +46,6 @@ /// let output: String = "abc".pad(6, Alignment::Left, Symbol::Whitespace); /// ``` /// - use std::clone; /// Exhaustive enum for the alternative ways to pad and format data. From 83db1bc4a008f2641bec03eea65ced61a8bc5515 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Tue, 19 Dec 2023 16:49:25 +0100 Subject: [PATCH 6/6] [fix] cd run cargo publish with env variable --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1cbf2bf..86ad4a3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -26,5 +26,5 @@ jobs: command: check - name: Cargo publish run: cargo publish --token ${CRATES_TOKEN} - env: - CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} + env: + CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}