A GitHub Action to prepare for shipping time. 🚢
This is a simple and opinionated Action that works by automating release tags using a Calendar Versioning scheme.
The Action can also generate a basic Changelog between HEAD
and the last applied tag.
The outputs from this Action can then be used to pass to actions/create-release
.
The following inputs are available:
Input | Required | Description | Default | Examples | |
---|---|---|---|---|---|
log_level | False | Sets the log level for debugging purposes | INFO |
DEBUG INFO WARN ERR |
|
tag_enable | False | Enable to apply a git tag. Disable if you just want release notes output. | FALSE |
TRUE FALSE |
|
tag_force | False | Enable to force applying the tag. This will move a past tag if there was a CalVer scheme collision. When disabled an error will not be thrown so the build will pass, there will just be no new tag applied. |
FALSE |
TRUE FALSE |
|
git_pretty_format | False | The format to provide to git log --pretty |
* %G? %h %aN %s" |
||
calver_scheme | False | The CalVer scheme to use. Refer to the details below. | YYYY.0M.0D-GEN |
YYYY.0M.0D-GEN-dev |
|
calver_split | False | The separator to use between MAJOR MINOR MICRO MODIFIER |
. |
- |
. |
calver_split_mod | False | The separator to use between MICRO and MODIFIER . Defaults to the same as calver_split |
. |
- |
. |
timezone | False | The timezone to export the CalVer in | UTC-0 | Examples |
The following outputs are available:
Output | Description | Example |
---|---|---|
changelog | A Changelog between HEAD and the last tag |
* This is an amazing commit message |
calver | Calendar Version generated in the provided scheme | 2020.05.01-alpha |
repo_owner | The GitHub repository organisation or owner | salt-labs |
repo_name | The GitHub repository name | action-its-shipping-time |
The following secrets are used by the Action:
Secret | Description | Example |
---|---|---|
GITHUB_TOKEN | The GitHub Token to push the modified tags | ${{secrets.GITHUB_TOKEN}} |
- None
Refer to the included examples directory.
The CalVer scheme is summarised as follows: MAJOR.MINOR.MICRO.MODIFIER
- Major - The first number in the version. The major segment is the most common calendar-based component.
- Minor - The second number in the version.
- Micro - The third and usually final number in the version. Sometimes referred to as the "patch" segment.
- Modifier - An optional text tag or revision number, such as "dev", "alpha", "beta", "rc1", "3".
The vast majority of modern version identifiers are composed of two or three numeric segments, plus the optional modifier. Convention suggests that four-numeric-segment versions are discouraged.
YYYY
- Full year - 2006, 2016, 2106YY
- Short year - 6, 16, 1060Y
- Zero-padded year - 06, 16, 106MM
- Short month - 1, 2 ... 11, 120M
- Zero-padded month - 01, 02 ... 11, 12WW
- Short week (since start of year) - 1, 2, 33, 520W
- Zero-padded week - 01, 02, 33, 52DD
- Short day - 1, 2 ... 30, 310D
- Zero-padded day - 01, 02 ... 30, 31GEN
- Increment a number based on the last found Git tag for this numeric segment.
Syntax | Output |
---|---|
YYYY.MM.GEN |
2020.6.1 |
YYYY.0D.0M-GEN |
2020.25.05-1 |
YYYY.0D.GEN |
2020.25.1 |
YY-MM-0W |
20-5-21 |
YY-MM-0W.GEN |
20-5-21.1 |
YY.MM-GEN |
20.5-1 |
A list of available TZ Database time zones are available HERE.