generated from tj-actions/docker-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
70 lines (66 loc) · 2.26 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Cargo Bump
description: Bump Cargo.toml version
author: tj-actions
inputs:
release_type:
description: 'The release type (major, minor, patch). (Default: the diff between the current tag and the previous tag)'
required: false
default: ''
working-directory:
description: 'Working directory'
required: false
default: '.'
outputs:
release_type:
description: 'The difference between two versions by the release type (major, minor, patch)'
value: ${{ steps.semver-diff.outputs.release_type || inputs.release_type }}
new_version:
description: 'The current project version'
value: ${{ steps.semver-diff.outputs.new_version }}
old_version:
description: 'The previous project version'
value: ${{ steps.semver-diff.outputs.old_version }}
runs:
using: 'composite'
steps:
- name: Run semver-diff
if: inputs.release_type == ''
id: semver-diff
uses: tj-actions/semver-diff@v3
with:
initial_release_type: ${{ inputs.release_type }}
- name: Install stable toolchain
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/cache@v4
id: cache-cargo-bump
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.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: |
if [[ -z "${{ inputs.release_type }}" ]]; then
cargo bump ${{ steps.semver-diff.outputs.release_type }}
else
cargo bump ${{ inputs.release_type }}
fi
cargo update --workspace
branding:
icon: check-square
color: white