Skip to content

Commit

Permalink
fix: only install cargo-bump if it hasn't been installed previously (#72
Browse files Browse the repository at this point in the history
)

* fix: only install cargo-bump if it hasn't been installed previously

* Update action.yml

* Update action.yml

* Update action.yml
  • Loading branch information
jackton1 authored Sep 26, 2024
1 parent 247b6d8 commit a669912
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ runs:
toolchain: stable
override: true
- uses: actions/cache@v4
id: cache-cargo-bump
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
with:
path: |
Expand All @@ -47,12 +48,17 @@ runs:
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-cargo-bump

- name: Install cargo-bump
shell: bash
if: steps.cache-cargo-bump.outputs.cache-hit != 'true' && (steps.semver-diff.outputs.release_type != '' || inputs.release_type != '')
run: cargo install cargo-bump

- name: Bump Cargo.toml version
shell: bash
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
working-directory: ${{ inputs.working-directory }}
run: |
cargo install cargo-bump
if [[ -z "${{ inputs.release_type }}" ]]; then
cargo bump ${{ steps.semver-diff.outputs.release_type }}
else
Expand Down

0 comments on commit a669912

Please sign in to comment.