mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 13:08:17 +00:00
Update documentation
This commit is contained in:
parent
fccf69567f
commit
c81b8f3498
2 changed files with 17 additions and 5 deletions
|
|
@ -50,7 +50,7 @@ outputs:
|
||||||
version:
|
version:
|
||||||
description: "The version result, in the format {major}.{minor}.{patch}"
|
description: "The version result, in the format {major}.{minor}.{patch}"
|
||||||
version_tag:
|
version_tag:
|
||||||
description: "The version result with trailing zeros removed"
|
description: "The version tag"
|
||||||
changed:
|
changed:
|
||||||
description: "Indicates whether there was a change since the last version if change_path was specified. If no change_path was specified this value will always be true since the entire repo is considered."
|
description: "Indicates whether there was a change since the last version if change_path was specified. If no change_path was specified this value will always be true since the entire repo is considered."
|
||||||
runs:
|
runs:
|
||||||
|
|
|
||||||
20
readme.md
20
readme.md
|
|
@ -64,7 +64,7 @@ it will be given the new version if the build were to be retriggered, for exampl
|
||||||
<!-- start usage -->
|
<!-- start usage -->
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: paulhatch/semantic-version@v3.2
|
- uses: paulhatch/semantic-version@v3.3
|
||||||
with:
|
with:
|
||||||
# The prefix to use to identify tags
|
# The prefix to use to identify tags
|
||||||
branch: "master"
|
branch: "master"
|
||||||
|
|
@ -76,7 +76,7 @@ it will be given the new version if the build were to be retriggered, for exampl
|
||||||
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
|
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
|
||||||
minor_pattern: "(MINOR)"
|
minor_pattern: "(MINOR)"
|
||||||
# A string to determine the format of the version output
|
# A string to determine the format of the version output
|
||||||
format: "${major}.${minor}.${patch}-prerelease.${increment}"
|
format: "${major}.${minor}.${patch}-prerelease${increment}"
|
||||||
# Optional path to check for changes. If any changes are detected in the path the
|
# Optional path to check for changes. If any changes are detected in the path the
|
||||||
# 'changed' output will true. Enter multiple paths separated by spaces.
|
# 'changed' output will true. Enter multiple paths separated by spaces.
|
||||||
change_path: "src/my-service"
|
change_path: "src/my-service"
|
||||||
|
|
@ -89,6 +89,14 @@ it will be given the new version if the build were to be retriggered, for exampl
|
||||||
bump_each_commit: false
|
bump_each_commit: false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- *major*, *minor*, and *patch* provide the version numbers that have been determined for this commit
|
||||||
|
- *increment* is an additional value indicating the number of commits for the current version, starting at zero. This can be used as part of a pre-release label.
|
||||||
|
- *version* is a formatted version string created using the format input. This is a convenience value to provide a preformatted representation of the data generated by this action.
|
||||||
|
- *version_tag* is a string identifier that would be used to tag the current commit as the "released" version. Typically this would only be used to generate a Git tag name.
|
||||||
|
- *changed* indicates whether there was a change since the last version if change_path was specified. If no `change_path` was specified this value will always be true since the entire repo is considered. (It is possible to create a commit with no changes, but the Git cli rejects this by default and this case is not considered here)
|
||||||
|
|
||||||
## Using Multiple Versions in the Same Repository
|
## Using Multiple Versions in the Same Repository
|
||||||
|
|
||||||
It is possible to create additional versions for multiple project co-existing
|
It is possible to create additional versions for multiple project co-existing
|
||||||
|
|
@ -116,12 +124,12 @@ job referencing semantic version multiple times. For example:
|
||||||
```yaml
|
```yaml
|
||||||
- name: Application Version
|
- name: Application Version
|
||||||
id: version
|
id: version
|
||||||
uses: paulhatch/semantic-version@v3.2
|
uses: paulhatch/semantic-version@v3.3
|
||||||
with:
|
with:
|
||||||
change_path: "src/service"
|
change_path: "src/service"
|
||||||
- name: Database Version
|
- name: Database Version
|
||||||
id: db-version
|
id: db-version
|
||||||
uses: paulhatch/semantic-version@v3.2
|
uses: paulhatch/semantic-version@v3.3
|
||||||
with:
|
with:
|
||||||
major_pattern: "(MAJOR-DB)"
|
major_pattern: "(MAJOR-DB)"
|
||||||
minor_pattern: "(MINOR-DB)"
|
minor_pattern: "(MINOR-DB)"
|
||||||
|
|
@ -143,3 +151,7 @@ zero to pull the full history and tags.
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Tips for Getting Started
|
||||||
|
|
||||||
|
- Unless the current commit is already tagged, the version produced by this action will be one value ahead of the last tag.
|
||||||
|
- There are two types of "version" string, one is the semantic version output that can be used to identify a build and can include prerelease data and metadata specific to the commit such as `v2.0.1-pre001+cf6e75`, the other is the tag version string, which identifies a specific commit as being a specific version.
|
||||||
Loading…
Reference in a new issue