From fc9bb9684e2b2683a8c5d6bcdf1aa8ac162c1592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20de=20L=C3=A1zari?= Date: Wed, 6 Dec 2023 18:22:44 -0300 Subject: [PATCH] Add ci for crate.io publish (#30) * Add ci for crate.io publish * Remove release job restriction to check if working properly * Add the tag restriction back and update the version --- .github/workflows/rust.yml | 15 +++++++++++++++ Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e6d5a19..99e5249 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,6 +3,8 @@ name: TestRust on: push: branches: [ "main" ] + tags: + - '*' pull_request: branches: [ "main" ] @@ -22,3 +24,16 @@ jobs: run: cargo test --verbose - name: Run benchmarks run: cargo bench + + release: + name: Release-Crate + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [build] + steps: + - uses: actions/checkout@v3 + - name: Publish crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish + diff --git a/Cargo.toml b/Cargo.toml index fb86356..f6abc00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustrees" -version = "0.2.0" +version = "0.2.2" edition = "2021" authors = [ "Guilherme Lázari ",