-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
94 lines (87 loc) · 3.03 KB
/
action.yml
File metadata and controls
94 lines (87 loc) · 3.03 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
name: SemanticVersioner
description: >
A GitHub Action to increment the version based on convention commits and whether we are in a dev or main branch
author: Hugh Macdonald
inputs:
main-branch:
description: The main branch to use
required: false
default: main
dev-branch:
description: The development branch to use (if required)
required: false
default: ""
dev-suffix:
description: The suffix to use for development versions
required: false
default: dev
include-shorter-versions:
description: Include shorter versions of tags that move as new versions are created
required: false
default: "false"
skip-python-install:
description: Skip the installation of Python (if it's already installed)
required: false
default: "false"
use-semantic-dev-versions:
description: >
Whether to use semantic versioning for the development (suffix) versions. If this
is set to false, the development versions will be a simple incrementing number. If
this is set to true, the development versions will be something like 1.2.3-dev.4.5.6
required: false
default: "false"
changelog-file:
description: The file to write the changelog to
required: false
default: ""
changelog-message:
description: An optional changelog message to add
required: false
default: ""
dry-run:
description: Only calculate and output the version without creating tags or writing changelog
required: false
default: "false"
outputs:
previous-version:
description: >
The version before the version was incremented. This may be the same as the new version.
value: ${{ steps.increment-version.outputs.previous-version }}
new-version:
description: >
The new version after the version was incremented. This may be the same as the previous
version.
value: ${{ steps.increment-version.outputs.new-version }}
runs:
using: "composite"
steps:
- name: Set up Python
if: ${{ !contains(fromJSON('["1", "y", "yes", "on", "true", "t"]'), inputs.skip-python-install) }}
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
uses: BSFishy/pip-action@v1
with:
packages: |
semver
gitpython
- name: Increment version
id: increment-version
run: python ${{ github.action_path }}/main.py
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
env:
GIT_EMAIL: ${{ inputs.git-email }}
GIT_USERNAME: ${{ inputs.git-username }}
MAIN_BRANCH: ${{ inputs.main-branch }}
DEV_BRANCH: ${{ inputs.dev-branch }}
DEV_SUFFIX: ${{ inputs.dev-suffix }}
INCLUDE_SHORTER_VERSIONS: ${{ inputs.include-shorter-versions }}
USE_SEMANTIC_DEV_VERSIONS: ${{ inputs.use-semantic-dev-versions }}
CHANGELOG_FILE: ${{ inputs.changelog-file }}
CHANGELOG_MESSAGE: ${{ inputs.changelog-message }}
DRY_RUN: ${{ inputs.dry-run }}
PUSH: 1
branding:
color: blue
icon: arrow-up-circle