-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
167 lines (162 loc) · 6.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: "Automatic Versioning Tag"
branding:
icon: 'git-branch'
color: 'black'
description: "Calculate your next version tag based on file changes automatically using SemVer v2.0.0 syntax"
inputs:
target-commit:
description: "Commit to compare changes against (usually branch merging to)"
required: true
default: ""
source-commit:
description: "Commit to compare changes to target-commit (usually pr branch to merge)"
required: true
patch-limit:
description: "Top how many % of changes limit to increase a patch version vX.Y.(Z+1)"
default: "10"
minor-limit:
description: "Top how many % of changes limit to increase a minor version vX.(Y+1).Z"
default: "75"
directory:
description: "Base directory to check the changes"
default: "."
exclude:
description: "List of files, paths, patterns (./*path*) to exclude from changes checking (space separated)"
default: ""
include-only:
description: "List of files, paths, patterns (./*path*) to include only for changes checking (space separated)"
default: ""
important-files:
description: "List of files, paths, patterns (./*path*) to mark as important for changes checking (space separated)"
default: ""
importance-rate:
description: "How important an important file will be (default 1.1)"
default: "1.1"
v-prefix:
description: "Include the 'v' prefix in the version tag: vX.Y.Z"
default: "true"
is-alpha:
description: "Mark this version as an alpha"
default: "false"
is-beta:
description: "Mark this version as a beta"
default: "false"
is-rc:
description: "Mark this version as a release candidate"
default: "false"
is-draft:
description: "Mark this version as a draft"
default: "false"
is-prerelease:
description: "Mark this version as a prerelease"
default: "false"
debug:
description: "Show debug messages"
default: "false"
create-tag:
description: "Create release tag after calculating it"
default: "true"
prerelease-tag:
description: "Prerelease tag to add at the end of the version tag"
default: ""
build-metadata:
description: "Build metadata to add at the end of the version tag"
default: ""
github-token:
description: "Github Token to create the tag at the end of the process (required if want to create tag at the end)"
action-path:
required: false
default: ./.github/actions/.auto-versioning
outputs:
version_str:
description: "version string"
value: ${{ steps.main-process.outputs.version_str }}
major:
description: "Version major number"
value: ${{ steps.main-process.outputs.major }}
minor:
description: "Version minor number"
value: ${{ steps.main-process.outputs.minor }}
patch:
description: "Version patch number"
value: ${{ steps.main-process.outputs.patch }}
prerelease:
description: "Version prerelease info"
value: ${{ steps.main-process.outputs.prerelease }}
build-metadata:
description: "Version build-metadata info"
value: ${{ steps.main-process.outputs.build_metadata }}
files-changed:
description: How many files were changed between commits
value: ${{ steps.main-process.outputs.files_changed }}
files-added:
description: How many files were added between commits
value: ${{ steps.main-process.outputs.files_added }}
files-removed:
description: How many files were removed between commits
value: ${{ steps.main-process.outputs.files_removed }}
insertions:
description: How many lines were added between commits
value: ${{ steps.main-process.outputs.insertions }}
deletions:
description: How many lines were removed between commits
value: ${{ steps.main-process.outputs.deletions }}
max-change-percentage:
description: The maximum change percentage between commits
value: ${{ steps.main-process.outputs.max_percentage }}
min-change-percentage:
description: The minimum change percentage between commits
value: ${{ steps.main-process.outputs.min_percentage }}
avg-change-percentage:
description: The average change percentage between commits
value: ${{ steps.main-process.outputs.avg_percentage }}
cumulative-change-percentage:
description: The sum of all change percentages between commits
value: ${{ steps.main-process.outputs.cumulative_percentage }}
runs:
using: "composite"
steps:
- name: 📩 Checkout Source
uses: actions/checkout@v4
with:
repository: HenryCabarcas/auto-versioning
path: ${{ inputs.action-path }}
- name: 🐍 Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: ⏬ Install the gh cli
uses: dev-hanz-ops/[email protected]
with:
gh-cli-version: 2.67.0
- name: 🐞 Debug context
shell: bash
if: inputs.debug == 'true'
run: echo '${{ toJson(github) }}'
- name: 🤖 Automatic version tag
id: main-process
run: ${{ inputs.action-path }}/start.sh
shell: bash
env:
ACTION_WORKDIR: ${{ inputs.action-path }}
SRC_PATH: ${{ github.workspace }}
GH_TOKEN: ${{ inputs.github-token || github.token }}
target_commit: "${{ inputs.target-commit }}"
source_commit: "${{ inputs.source-commit }}"
patch_limit: "${{ inputs.patch-limit }}"
minor_limit: "${{ inputs.minor-limit }}"
directory: "${{ inputs.directory }}"
exclude: "${{ inputs.exclude }}"
include_only: "${{ inputs.include-only }}"
important_files: "${{ inputs.important-files }}"
importance_rate: "${{ inputs.importance-rate }}"
v_prefix: "${{ inputs.v-prefix }}"
is_alpha: "${{ inputs.is-alpha }}"
is_beta: "${{ inputs.is-beta }}"
is_rc: "${{ inputs.is-rc }}"
is_draft: "${{ inputs.is-draft }}"
is_prerelease: "${{ inputs.is-prerelease }}"
create_tag: "${{ inputs.create-tag }}"
prerelease_tag: "${{ inputs.prerelease-tag }}"
build_metadata: "${{ inputs.build-metadata }}"
debug: "${{ inputs.debug }}"