Repository: goreleaser/goreleaser
Pull request #2850 (2022-01-27 02:24:16)

fix(aur): version must be numbers only
fixes aur pkgbuilds, versions should be numbers only.

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2850](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (e8476d6) into [main](https://codecov.io/gh/goreleaser/goreleaser/commit/9aa00c7f3f6e1051f9deb10805bdc9ed06f32f8f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (9aa00c7) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2850/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@           Coverage Diff           @@
##             main    #2850   +/-   ##
=======================================
  Coverage   84.45%   84.45%           
=======================================
  Files         111      111           
  Lines        8801     8801           
=======================================
  Hits         7433     7433           
  Misses       1101     1101           
  Partials      267      267           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [internal/pipe/aur/aur.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9hdXIvYXVyLmdv) | `80.65% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [9aa00c7...e8476d6](https://codecov.io/gh/goreleaser/goreleaser/pull/2850?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/internal/pipe/aur/aur.go b/internal/pipe/aur/aur.go
index 1d7e81e9..e98049ae 100644
--- a/internal/pipe/aur/aur.go
+++ b/internal/pipe/aur/aur.go
@@ -278,7 +278,7 @@ func dataFor(ctx *context.Context, cfg config.AUR, cl client.Client, artifacts [
 		Name:         cfg.Name,
 		Desc:         cfg.Description,
 		Homepage:     cfg.Homepage,
-		Version:      ctx.Version,
+		Version:      fmt.Sprintf("%d.%d.%d", ctx.Semver.Major, ctx.Semver.Minor, ctx.Semver.Patch),
 		License:      cfg.License,
 		Rel:          cfg.Rel,
 		Maintainers:  cfg.Maintainers,
diff --git a/www/docs/deprecations.md b/www/docs/deprecations.md
index 56ce6e43..c84fa88d 100644
--- a/www/docs/deprecations.md
+++ b/www/docs/deprecations.md
@@ -40,7 +40,7 @@ Description.
 
 > since 2022-01-20 (v1.4.0)
 
-On [GoReleaser PRO][pro], custom variables should now be prefixed with `.Var`.
+On [GoReleaser PRO](/pro/) custom variables should now be prefixed with `.Var`.
 
 === "Before"
 
diff --git a/www/docs/install.md b/www/docs/install.md
index 3b5c0f98..186922aa 100644
--- a/www/docs/install.md
+++ b/www/docs/install.md
@@ -104,6 +104,18 @@ Below you can find the steps for each of them.
     sudo yum install goreleaser-pro
     ```
 
+### aur
+
+=== "OSS"
+    ```sh
+    yay -S goreleaser-bin
+    ```
+
+=== "Pro"
+    ```sh
+    yay -S goreleaser-pro-bin
+    ```
+
 ### deb, rpm and apk packages
 
 


Test patch:
diff --git a/internal/pipe/aur/aur_test.go b/internal/pipe/aur/aur_test.go
index 6fcd05e4..605b918b 100644
--- a/internal/pipe/aur/aur_test.go
+++ b/internal/pipe/aur/aur_test.go
@@ -233,9 +233,15 @@ func TestFullPipe(t *testing.T) {
 			folder := t.TempDir()
 			ctx := &context.Context{
 				Git: context.GitInfo{
-					CurrentTag: "v1.0.1",
+					CurrentTag: "v1.0.1-foo",
 				},
-				Version:   "1.0.1",
+				Semver: context.Semver{
+					Major:      1,
+					Minor:      0,
+					Patch:      1,
+					Prerelease: "foo",
+				},
+				Version:   "1.0.1-foo",
 				Artifacts: artifact.New(),
 				Env: map[string]string{
 					"FOO": "foo_is_bar",
@@ -316,6 +322,11 @@ func TestRunPipe(t *testing.T) {
 		Git: context.GitInfo{
 			CurrentTag: "v1.0.1",
 		},
+		Semver: context.Semver{
+			Major: 1,
+			Minor: 0,
+			Patch: 1,
+		},
 		Version:   "1.0.1",
 		Artifacts: artifact.New(),
 		Env: map[string]string{
@@ -455,6 +466,11 @@ func TestRunPipeBinaryRelease(t *testing.T) {
 		Git: context.GitInfo{
 			CurrentTag: "v1.2.1",
 		},
+		Semver: context.Semver{
+			Major: 1,
+			Minor: 2,
+			Patch: 1,
+		},
 		Version:   "1.2.1",
 		Artifacts: artifact.New(),
 		Config: config.Project{
@@ -504,6 +520,12 @@ func TestRunPipeNoUpload(t *testing.T) {
 	})
 	ctx.TokenType = context.TokenTypeGitHub
 	ctx.Git = context.GitInfo{CurrentTag: "v1.0.1"}
+	ctx.Semver = context.Semver{
+		Major: 1,
+		Minor: 0,
+		Patch: 1,
+	}
+
 	path := filepath.Join(folder, "whatever.tar.gz")
 	f, err := os.Create(path)
 	require.NoError(t, err)
@@ -558,6 +580,11 @@ func TestRunEmptyTokenType(t *testing.T) {
 		},
 	})
 	ctx.Git = context.GitInfo{CurrentTag: "v1.0.1"}
+	ctx.Semver = context.Semver{
+		Major: 1,
+		Minor: 0,
+		Patch: 1,
+	}
 	path := filepath.Join(folder, "whatever.tar.gz")
 	f, err := os.Create(path)
 	require.NoError(t, err)
diff --git a/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.pkgbuild.golden b/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.pkgbuild.golden
index 7c19c2bd..10543e1f 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.pkgbuild.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.pkgbuild.golden
@@ -10,7 +10,7 @@ license=('MIT')
 provides=('default-gitlab')
 conflicts=('default-gitlab')
 
-source_x86_64=('https://dummyhost/download/v1.0.1/bin.tar.gz')
+source_x86_64=('https://dummyhost/download/v1.0.1-foo/bin.tar.gz')
 sha256sums_x86_64=('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
 
 package() {
diff --git a/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.srcinfo.golden b/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.srcinfo.golden
index 5dfd2637..311becea 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.srcinfo.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/default-gitlab.srcinfo.golden
@@ -7,7 +7,7 @@ pkgbase = default-gitlab-bin
 	conflicts = default-gitlab
 	provides = default-gitlab
 	arch = x86_64
-	source_x86_64 = https://dummyhost/download/v1.0.1/bin.tar.gz
+	source_x86_64 = https://dummyhost/download/v1.0.1-foo/bin.tar.gz
 	sha256sums_x86_64 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
 	
 pkgname = default-gitlab-bin
diff --git a/internal/pipe/aur/testdata/TestFullPipe/default.pkgbuild.golden b/internal/pipe/aur/testdata/TestFullPipe/default.pkgbuild.golden
index 0d99bb19..ead70e19 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/default.pkgbuild.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/default.pkgbuild.golden
@@ -10,7 +10,7 @@ license=('MIT')
 provides=('default')
 conflicts=('default')
 
-source_x86_64=('https://dummyhost/download/v1.0.1/bin.tar.gz')
+source_x86_64=('https://dummyhost/download/v1.0.1-foo/bin.tar.gz')
 sha256sums_x86_64=('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
 
 package() {
diff --git a/internal/pipe/aur/testdata/TestFullPipe/default.srcinfo.golden b/internal/pipe/aur/testdata/TestFullPipe/default.srcinfo.golden
index f75f1dc8..7bd5861e 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/default.srcinfo.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/default.srcinfo.golden
@@ -7,7 +7,7 @@ pkgbase = default-bin
 	conflicts = default
 	provides = default
 	arch = x86_64
-	source_x86_64 = https://dummyhost/download/v1.0.1/bin.tar.gz
+	source_x86_64 = https://dummyhost/download/v1.0.1-foo/bin.tar.gz
 	sha256sums_x86_64 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
 	
 pkgname = default-bin
diff --git a/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.pkgbuild.golden b/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.pkgbuild.golden
index d4ef3315..c7a3348e 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.pkgbuild.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.pkgbuild.golden
@@ -14,7 +14,7 @@ conflicts=('libcurl' 'cvs' 'blah')
 depends=('curl' 'bash')
 optdepends=('wget: stuff' 'foo: bar')
 
-source_x86_64=('https://dummyhost/download/v1.0.1/bin.tar.gz')
+source_x86_64=('https://dummyhost/download/v1.0.1-foo/bin.tar.gz')
 sha256sums_x86_64=('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
 
 package() {
diff --git a/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.srcinfo.golden b/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.srcinfo.golden
index f946585d..ea1151a5 100644
--- a/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.srcinfo.golden
+++ b/internal/pipe/aur/testdata/TestFullPipe/with-more-opts.srcinfo.golden
@@ -14,7 +14,7 @@ pkgbase = with-more-opts-bin
 	provides = git
 	provides = svn
 	arch = x86_64
-	source_x86_64 = https://dummyhost/download/v1.0.1/bin.tar.gz
+	source_x86_64 = https://dummyhost/download/v1.0.1-foo/bin.tar.gz
 	sha256sums_x86_64 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
 	
 pkgname = with-more-opts-bin