From 0cdebaa51f78d6386dcb21867e01c511465baa69 Mon Sep 17 00:00:00 2001 From: Jacek W Date: Thu, 4 Jan 2024 22:00:03 +0100 Subject: [PATCH] Create rust.yml --- .github/workflows/rust.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..45247d5 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,34 @@ +name: Publish New Version + +on: + workflow_dispatch: + + + +env: + CARGO_TERM_COLOR: always + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Ensures history is available for tags + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Bump version and create tag + if: github.ref == 'refs/heads/main' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + cargo install cargo-bump + VERSION=$(cargo bump patch) # You can also use 'minor' or 'major' + git commit -am "Bump version to $VERSION" + git tag $VERSION + git push && git push --tags