Files
version-increment/action.yml

101 lines
3.9 KiB
YAML
Raw Normal View History

2021-10-20 11:18:23 +11:00
---
name: 'Version Increment'
description: Inspects the git tags to determine the current normal version, and returns the next version number
2021-10-20 11:18:23 +11:00
branding:
icon: plus
color: purple
2021-10-20 11:18:23 +11:00
inputs:
scheme:
description: |
Versioning scheme - semver, calver or conventional_commits (defaults to semver).
2024-04-23 17:13:22 +10:00
`conventional_commits` Will parse the last commit message (e.g. the merge commit) to
determine the increment type, and supports the following increment types by keyword:
- patch (build, chore, ci, docs, fix, perf, refactor, revert, style, test)
- minor (feat)
2024-04-23 17:13:22 +10:00
- major (any of the above keywords followed by a '!' character, or 'BREAKING CHANGE:' in commit body)
2021-10-20 11:18:23 +11:00
required: false
default: 'semver'
pep440:
description: 'PEP440 compatibility mode - shifts the pre-release version information into build metadata instead'
required: false
default: false
2021-10-20 11:18:23 +11:00
increment:
description: |
Field to increment - major, minor, or, patch (defaults to patch)
2024-04-23 17:13:22 +10:00
If using the `conventional_commits` scheme, this is the default increment if the parsing of the merge commit fails to
find conventional commits information
2021-10-20 11:18:23 +11:00
Not applicable to `calver` scheme
required: false
default: 'patch'
2023-08-25 16:46:55 +01:00
release_branch:
2023-09-16 10:06:06 +10:00
description: 'Specify a non-default branch to use for the release tag (the one without -pre)'
required: false
2023-08-25 16:46:55 +01:00
type: string
use_api:
description: 'Use the GitHub API to discover current tags, which avoids the need for a git checkout, but requires `curl` and `jq`'
required: false
default: false
2021-10-20 11:18:23 +11:00
outputs:
current-version:
2021-10-20 11:18:23 +11:00
description: 'Current normal version detected'
value: ${{ steps.version-lookup.outputs.CURRENT_VERSION }}
current-v-version:
description: 'Current normal version detected, prefixed with a `v` character'
value: ${{ steps.version-lookup.outputs.CURRENT_V_VERSION }}
2021-10-20 11:18:23 +11:00
version:
description: 'Incremented version calculated'
value: ${{ steps.version-increment.outputs.VERSION }}
v-version:
description: 'Incremented version calculated, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.V_VERSION }}
major-version:
description: 'Major number of the incremented version'
value: ${{ steps.version-increment.outputs.MAJOR_VERSION }}
minor-version:
description: 'Minor number of the incremented version'
value: ${{ steps.version-increment.outputs.MINOR_VERSION }}
patch-version:
description: 'Patch number of the incremented version'
value: ${{ steps.version-increment.outputs.PATCH_VERSION }}
2023-03-10 12:40:51 +11:00
pre-release-label:
description: 'Pre-release label of the incremented version'
value: ${{ steps.version-increment.outputs.PRE_RELEASE_LABEL }}
major-v-version:
description: 'Major number of the incremented version, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.MAJOR_V_VERSION }}
minor-v-version:
description: 'Minor number of the incremented version, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.MINOR_V_VERSION }}
patch-v-version:
description: 'Patch number of the incremented version, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.PATCH_V_VERSION }}
2021-10-20 11:18:23 +11:00
runs:
using: "composite"
steps:
- id: version-lookup
run: $GITHUB_ACTION_PATH/version-lookup.sh
2021-10-20 11:18:23 +11:00
shell: bash
env:
github_token: ${{ github.token }}
scheme: ${{ inputs.scheme }}
use_api: ${{ inputs.use_api }}
2021-10-20 11:18:23 +11:00
- id: version-increment
2024-03-05 12:13:08 +01:00
run: $GITHUB_ACTION_PATH/version-increment.sh
2021-10-20 11:18:23 +11:00
shell: bash
env:
current_version: ${{ steps.version-lookup.outputs.CURRENT_VERSION }}
increment: ${{ inputs.increment }}
github_token: ${{ github.token }}
pep440: ${{ inputs.pep440 }}
scheme: ${{ inputs.scheme }}
2023-08-25 16:46:55 +01:00
release_branch: ${{ inputs.release_branch }}
use_api: ${{ inputs.use_api }}