Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
109 lines (104 loc) · 3.9 KB
/
Copy pathaction.yml
File metadata and controls
109 lines (104 loc) · 3.9 KB
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
name: 'Code Of Chaos Version Bumper'
description: 'Bump semantic versions in project files and optionally commit + tag'
author: 'Code-Of-Chaos'
branding:
icon: 'trending-up'
color: 'white'
inputs:
version_file:
description: 'Path to the file containing the version (supports XML files, JSON files like package.json, and plain text files like VERSION)'
required: true
bump:
description: 'Version bump type: major, minor, patch, preview, or custom'
required: true
custom_version:
description: 'Custom version string (only used when bump is "custom", e.g. 1.0.0 or 1.0.0-preview.1)'
required: false
default: ''
version_element:
description: 'XPath for XML files or dot-separated JSON key path. CMakeLists.txt uses project(... VERSION ...), and this input applies only to the canonical version_file.'
required: false
default: ''
additional_version_files:
description: 'Optional newline-separated repository-relative files to update to the calculated version. Uses each file type default location; version_element applies only to version_file.'
required: false
default: ''
commit:
description: 'Commit the version change'
required: false
default: 'false'
tag:
description: 'Create a git tag (format: v{version})'
required: false
default: 'false'
tag_prefix:
description: 'Prefix for the git tag'
required: false
default: 'v'
commit_message:
description: 'Commit message template ({version} is replaced with the new version)'
required: false
default: 'VersionBump : {tag}'
push:
description: 'Push commit and tag to origin'
required: false
default: 'false'
floating_major_version:
description: 'Create/update a floating major version tag (e.g. v1 for v1.2.0). Requires tag to be true.'
required: false
default: 'false'
floating_minor_version:
description: 'Create/update a floating minor version tag (e.g. v1.2 for v1.2.0). Requires tag to be true.'
required: false
default: 'false'
preview_label:
description: 'Label for preview versions (default: "preview"). E.g. "BETA" for 1.0.1-BETA-1'
required: false
default: 'preview'
preview_separator:
description: 'Separator between preview label and number (default: "."). E.g. "-" for 1.0.1-BETA-1'
required: false
default: '.'
outputs:
version:
description: 'The new version string'
value: ${{ steps.bump.outputs.version }}
tag:
description: 'The created git tag name'
value: ${{ steps.bump.outputs.tag }}
old_version:
description: 'The previous version string'
value: ${{ steps.bump.outputs.old_version }}
floating_major_tag:
description: 'The floating major version tag name, if enabled'
value: ${{ steps.bump.outputs.floating_major_tag }}
floating_minor_tag:
description: 'The floating minor version tag name, if enabled'
value: ${{ steps.bump.outputs.floating_minor_tag }}
runs:
using: 'composite'
steps:
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Bump Version
id: bump
shell: bash
env:
VERSION_FILE: ${{ inputs.version_file }}
BUMP: ${{ inputs.bump }}
CUSTOM_VERSION: ${{ inputs.custom_version }}
VERSION_ELEMENT: ${{ inputs.version_element }}
ADDITIONAL_VERSION_FILES: ${{ inputs.additional_version_files }}
COMMIT: ${{ inputs.commit }}
TAG: ${{ inputs.tag }}
TAG_PREFIX: ${{ inputs.tag_prefix }}
COMMIT_MESSAGE: ${{ inputs.commit_message }}
PUSH: ${{ inputs.push }}
FLOATING_MAJOR_VERSION: ${{ inputs.floating_major_version }}
FLOATING_MINOR_VERSION: ${{ inputs.floating_minor_version }}
PREVIEW_LABEL: ${{ inputs.preview_label }}
PREVIEW_SEPARATOR: ${{ inputs.preview_separator }}
VERSION_BUMPER_REQUIRE_RELATIVE_PATHS: 'true'
run: python "${{ github.action_path }}/src/action.py"