Class SemverBuildVarsGitHubAction
java.lang.Object
me.julb.applications.github.actions.SemverBuildVarsGitHubAction
- All Implemented Interfaces:
me.julb.sdk.github.actions.spi.GitHubActionProvider
public class SemverBuildVarsGitHubAction
extends Object
implements me.julb.sdk.github.actions.spi.GitHubActionProvider
The action to compute SemVer build vars.
- Author:
- Julb.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()(package private) StringGets the current timestamp.(package private) StringGets the "package_version" input.(package private) com.vdurmont.semver4j.SemvergetSemverVersion(@NonNull String version) Gets the semver verison object from the given version.
-
Constructor Details
-
SemverBuildVarsGitHubAction
public SemverBuildVarsGitHubAction()
-
-
Method Details
-
execute
public void execute()- Specified by:
executein interfaceme.julb.sdk.github.actions.spi.GitHubActionProvider
-
getInputPackageVersion
String getInputPackageVersion()Gets the "package_version" input.- Returns:
- the "package_version" input.
-
getSemverVersion
Gets the semver verison object from the given version.
Replaces aSNAPSHOTsuffix byunstablesuffix.- Parameters:
version- the version.- Returns:
- the semver object for that version.
- Throws:
IllegalArgumentException- if the version is not semver-valid.
-
getCurrentTimestamp
String getCurrentTimestamp()Gets the current timestamp.- Returns:
- the current timestamp formatted.
-