Template String
Some fields are parsed with Go's text/template and sprig.
caution
The following sprig functions are removed for security reason.
Common Template Functions
trimV
: This is equivalent totrimPrefix "v"
Template Variables
OS
: A string whichGOOS
is replaced byreplacements
. Ifreplacements
isn't set,OS
is equal toGOOS
. Basically you should useOS
for the consistencyArch
: A string whichGOARCH
is replaced byreplacements
. Ifreplacements
isn't set,Arch
is equal toGOARCH
. Basically you should useOS
for the consistencyGOOS
: Go's runtime.GOOSGOARCH
: Go's runtime.GOARCHVersion
: Packageversion
SemVer
: Package version that version_prefix is trimmed fromVersion
. For example, ifVersion
iscli/v1.0.0
andversion_prefix
iscli/
, thenSemVer
isv1.0.0
Format
: Packageformat
FileName
:files[].name
AssetWithoutExt
AssetWithoutExt
AssetWithoutExt
is a string that a file extension is removed from Asset
.
e.g.
asset: aks-engine-{{.Version}}-{{.OS}}-{{.Arch}}.tar.gz
files:
- name: aks-engine
src: "{{.AssetWithoutExt}}/aks-engine" # "{{.AssetWithoutExt}}" == "aks-engine-{{.Version}}-{{.OS}}-{{.Arch}}"
Omit Format
in asset
and url
The file extension is complemented if it isn't included in asset
and url
.
e.g.
asset: foo # This is same with `foo.tar.gz` and `foo.{{.Format}}`
format: tar.gz
You can unify the setting of raw
format and non raw
format.
Before
asset: kalker-{{.OS}}.{{.Format}}
format: zip
overrides:
- goos: linux
format: raw
asset: kalker-{{.OS}}
After
asset: kalker-{{.OS}}
format: zip
overrides:
- goos: linux
format: raw
You can disable the complementation by setting append_ext: false
.
append_ext: false
By default append_ext
is true
.