Skip to content

Latest commit

 

History

History
80 lines (76 loc) · 3.11 KB

atc.yaml.README.md

File metadata and controls

80 lines (76 loc) · 3.11 KB

Config file ATC .atc.yaml

Config file has Yaml format.
.Atc.yaml settings are always taken from default branch!

Action Inputs

  • Path: Path to package manager configuration file.
  • Behavior: Commit to be used to create tag.
  • Template: Tag template.
  • Branch: Branch for track version changes.
  • RegexStr: Regex String to get version from custom configuration file.

Examples:

  • Minimal configuration. When the configuration file pom.xml changes the version project in default branch from 1.0.0 to 1.0.1, this example will create the tag "v1.0.1" in current commit.
path: "pom.xml"
  • Full configuration with Node Package Manager. When the configurate file package.json changes the version project in release branch from 1.1.0 to 1.1.1, this example will create a tag "v1.1.1-alfaNPM" in previous commit.
path: "package.json"
behavior: "before"
template: "{{.Version}}-alfaNPM"
branch: "release"
  • Full configuration with custom package manager. When the configurate file custom_package_manager.txt changes the version project in release branch from 1.2.0 to 1.2.1, this example will create a tag "v1.2.1-custom" in previous commit.
path: "custom_package_manager.txt"
behavior: "before"
template: "{{.Version}}-custom"
branch: "release"
regexStr: "vers: (.+)"
File custom_package_manager.txt:
name: custom name
vers: 1.2.1
project: custom project

Сustomization ATC config file(.atc.yaml):

Path

ATC supports: Gradle(build.gradle), NPM(package.json), Maven(pom.xml), Flutter(pubspec.yaml) or generic config file if RegexStr is used. Path uses relative link to the package manager configuration file. Don't use "/" preffix.

path: "pom.xml"
path: "app/build.gradle"
path: "custom_package_manager.txt"

Behavior

ATC can create tag for current commit, use after for this, or previous commit, use before for this. The default behavior is after.

Behavior examples:
behavior: "after" # for use current commit
behavior: "before" # for use previous commit

Template

ATC Template works with GO Template. Use "{{.Version}}" to write the number to the tag. ATC supports the function time.Now(), to use it use {{Time}}. The default template is "v{{.Version}}".

Template examples:
template: "v{{.Version}}" # for version = 2.0.0, tag = "v2.0.0"
template: "v{{.Version}}-alfa{{.Version}}" # for version = 2.0.1, tag = "v2.0.1-alfa2.0.1"
template: "{{.Version}}-{{Time.Hour}}" # for version = 2.0.2, tag = "v2.0.2-`Hours now`"

Branch

ATC can track non-default branch.

Branch examples:
branch: "main"
branch: "issue-404"
branch: "customBranch"

RegexStr

Write Path to configuration file and create regex string if you are not using the default ATC package manager. The regexstr must contain one group with version number.

Regexstr examples:
regexstr: "version: (.+)" # for `version: 2.0.0`
regexstr: "\"version\": \"(.+)\"" # for `"version": "2.0.1""`