You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	Merge pull request #240 from goreleaser/version
added version to default name_template
This commit is contained in:
		| @@ -259,7 +259,7 @@ archive: | ||||
|   # - Os | ||||
|   # - Arch | ||||
|   # - Arm (ARM version) | ||||
|   # The default is `{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` | ||||
|   # The default is `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` | ||||
|   name_template: "{{.Binary}}_{{.Version}}_{{.Os}}_{{.Arch}}" | ||||
|  | ||||
|   # Archive format. Valid options are `tar.gz` and `zip`. | ||||
|   | ||||
| @@ -13,6 +13,7 @@ build: | ||||
|     - arm | ||||
|     - arm64 | ||||
| archive: | ||||
|   name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' | ||||
|   replacements: | ||||
|     darwin: Darwin | ||||
|     linux: Linux | ||||
|   | ||||
| @@ -73,9 +73,9 @@ func TestNameDefaltTemplate(t *testing.T) { | ||||
| 		Version: "1.2.3", | ||||
| 	} | ||||
| 	for key, target := range map[string]buildTarget{ | ||||
| 		"test_darwin_amd64": {"darwin", "amd64", ""}, | ||||
| 		"test_linux_arm64":  {"linux", "arm64", ""}, | ||||
| 		"test_linux_armv7":  {"linux", "arm", "7"}, | ||||
| 		"test_1.2.3_darwin_amd64": {"darwin", "amd64", ""}, | ||||
| 		"test_1.2.3_linux_arm64":  {"linux", "arm64", ""}, | ||||
| 		"test_1.2.3_linux_armv7":  {"linux", "arm", "7"}, | ||||
| 	} { | ||||
| 		t.Run(key, func(t *testing.T) { | ||||
| 			name, err := nameFor(ctx, target) | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| // NameTemplate default name_template for the archive. | ||||
| const NameTemplate = "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||||
| const NameTemplate = "{{ .Binary }}_{{.Version}}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||||
|  | ||||
| // SnapshotNameTemplate represents the default format for snapshot release names. | ||||
| const SnapshotNameTemplate = "SNAPSHOT-{{ .Commit }}" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user