1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-30 04:50:45 +02:00

fix: snapshot version template should not have the leading 'v'

closes #5142
This commit is contained in:
Carlos Alexandro Becker 2024-09-19 23:55:10 -03:00
parent bce9035aa2
commit d3f8bbf31a
No known key found for this signature in database
4 changed files with 14 additions and 4 deletions

View File

@ -74,7 +74,7 @@ func TestLive(t *testing.T) {
ctx.Config.ProjectName = "Goreleaser"
ctx.ReleaseURL = "https://goreleaser.com/customization/announce/bluesky"
ctx.Version = "v1.26.0"
ctx.Version = "1.26.0"
require.NoError(t, bluesky.Pipe{}.Default(ctx))
require.NoError(t, bluesky.Pipe{}.Announce(ctx))

View File

@ -62,11 +62,11 @@ func TestSnapshotEmptyFinalName(t *testing.T) {
func TestSnapshot(t *testing.T) {
ctx := testctx.NewWithCfg(config.Project{
Snapshot: config.Snapshot{
VersionTemplate: "{{ incpatch .Tag }}",
VersionTemplate: "{{ incpatch .Version }}",
},
}, testctx.WithCurrentTag("v1.2.3"))
}, testctx.WithVersion("1.2.3"))
require.NoError(t, Pipe{}.Run(ctx))
require.Equal(t, "v1.2.4", ctx.Version)
require.Equal(t, "1.2.4", ctx.Version)
}
func TestSkip(t *testing.T) {

View File

@ -35,6 +35,11 @@ nightly:
keep_single_release: true
```
!!! warning
Do not use the `{{.Tag}}` field in the `version_template`, as the version
should not have the leading `v`.
## How it works
When you run GoReleaser with `--nightly`, it will set the `Version` template

View File

@ -19,6 +19,11 @@ snapshot:
version_template: "{{ incpatch .Version }}-devel"
```
!!! warning
Do not use the `{{.Tag}}` field in the `version_template`, as the version
should not have the leading `v`.
## How it works
When you run GoReleaser with `--snapshot`, it will set the `Version` template