-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
74 lines (74 loc) · 2.71 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
71
72
73
74
name: 'Update Project Version'
description: 'Updates the project version based on commit messages'
inputs:
committer-email:
description: 'Committer e-mail'
required: false
default: 'github-actions[bot]@users.noreply.github.com'
committer-username:
description: 'Committer username'
required: false
default: 'github-actions[bot]'
extra-minor-commit-types:
description: 'Extra commit types for minor changes (comma separated list)'
required: false
default: ''
extra-patch-commit-types:
description: 'Extra commit types for patch changes (comma separated list)'
required: false
default: 'build,chore,ci,docs,perf,refactor,style,test'
latest-tag:
description: 'Indicates if an extra tag "latest" should be added'
required: false
default: 'false'
tag-prefix:
description: 'Git tag prefix (tag chars before the version chars)'
required: false
default: ''
tag-suffix:
description: 'Git tag suffix (tag chars after the version chars)'
required: false
default: ''
version-files:
description: 'Files to update with the new version (comma separated list)'
required: false
default: ''
runs:
using: "composite"
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to retrieve tags
- id: current_dir
name: Obtain current directory
run: echo "CURRENT_DIR=$(pwd)" >> $GITHUB_ENV
shell: bash
- id: safe_directory
name: Add safe directory
run: git config --global --add safe.directory "${{ env.CURRENT_DIR }}"
shell: bash
- id: set_path
run: echo "${GITHUB_ACTION_PATH}" >> $GITHUB_PATH
shell: bash
- id: current_version
name: Obtain current version
run: current_version.sh "${{ inputs.tag-prefix }}" "${{ inputs.tag-suffix }}"
shell: bash
- id: new_version
name: Obtain new version
run: new_version.sh "${{ github.event.head_commit.message }}" "${{ env.CURRENT_VERSION }}" "${{ inputs.extra-minor-commit-types }}" "${{ inputs.extra-patch-commit-types }}"
shell: bash
- id: update_files
name: Update version in specified files
run: update_files.sh "${{ inputs.version-files }}" "${{ env.CURRENT_VERSION }}" "${{ env.NEW_VERSION }}" "${{ github.actor }}" "${{ inputs.committer-email }}" "${{ inputs.committer-username }}"
shell: bash
- id: new_tag
name: Create new tag
run: new_tag.sh "${{ inputs.tag-prefix }}" "${{ inputs.tag-suffix }}" "${{ env.NEW_VERSION }}" "${{ inputs.latest-tag }}" "${{ inputs.committer-email }}" "${{ inputs.committer-username }}"
shell: bash
- id: git_push
name: Push changes to git
run: git_push.sh
shell: bash