1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
Commit Graph

1510 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
7fc93995b8
feat: consistently use directory in property names (#4737)
It was a mess of "folder" x "directory", so changed it all to
"directory".

Closes #4732
2024-04-01 10:01:56 -03:00
Carlos Alexandro Becker
1db9347363
feat(archives): format override to 'none' to skip certain goos (#4730)
closes #4644

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-29 16:20:05 -03:00
Carlos Alexandro Becker
8cd325eb5a
fix: support dir in gomod (#4729)
closes https://github.com/orgs/goreleaser/discussions/4728
2024-03-29 10:27:33 -03:00
Carlos Alexandro Becker
2498ea7029
feat: add metadata to the release (#4714)
this will create a metadata artifact and allow to add them to the
release.

closes #4669
closes #4682

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:41:41 -03:00
German Lashevich
ec7106fdea
feat(git): retry git clone on retriable error (#4725)
This PR adds retry logic to the process of cloning a git repository.
Currently, it retries only if the output of the git clone command
contains the string `Connection reset`.
Probably, there are more cases where retry is reasonable, but I'm not
sure what they are.

The number of retries is hardcoded to 10 with increasing delay between
retries — in the same way as it is done in #4265, which served me as an
example.

The initial use case is described in #4724.
2024-03-26 23:41:25 -03:00
Carlos Alexandro Becker
500be667af
feat(scoop): sync fork before opening PR
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:34:15 -03:00
Carlos Alexandro Becker
42b6282e46
feat(nix): sync fork before opening PR
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:34:15 -03:00
Carlos Alexandro Becker
2ecd71ee71
feat(krew): sync fork before opening PR
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:34:15 -03:00
Carlos Alexandro Becker
b9b8a65618
feat(brew): sync fork before opening PR
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:34:15 -03:00
Carlos Alexandro Becker
3687c097cd
feat(winget): sync fork before opening PR
closes https://github.com/goreleaser/goreleaser/issues/4720

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:34:15 -03:00
Carlos Alexandro Becker
05e8b33a89
fix: use new refresh func 2024-03-20 10:55:42 -03:00
Carlos Alexandro Becker
dc0de4ce59
fix: artifact filtering 2024-03-20 00:53:51 -03:00
Carlos Alexandro Becker
af97e63dd3
fix: improve artifact refresh and filtering 2024-03-20 00:49:34 -03:00
Carlos Alexandro Becker
08851dce61
fix(aur): allow to have multiple AUR configs pointing to the same repo (#4712)
- using the sha256 of the git url as repo name so we avoid race
conditions
- actually made the git client have a global lock so it doesn't step
over itself

closes #4679

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-19 23:53:08 -03:00
Carlos Alexandro Becker
6e0f426339
feat: allow to delete existing artifacts in the release (#4711)
closes #4692
2024-03-19 23:25:42 -03:00
Brad Reynolds
56c5a09f9a
feat: support projectID for gitlab CreateFile (brew, nix, etc) (#4705)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->
<!-- If applied, this commit will... -->

Allow for using a projectID for a gitlab homebrew tap destination. There
are still some issues here because I can't use our full project name but
one step at a time.

<!-- Why is this change being made? -->

According to the goreleaser [gitlab
doc](https://goreleaser.com/customization/release/#gitlab), gitlab's
project IDs are supported. Before this change that isn't true for
homebrew formulas.

<!-- # Provide links to any relevant tickets, URLs or other resources
-->
Some conversation here:
https://github.com/goreleaser/goreleaser/issues/4664#issuecomment-1986056251.

Co-authored-by: Brad Reynolds <brad@shipium.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-17 15:26:04 -03:00
Carlos Alexandro Becker
54ee014b50
feat: checksums.split (#4707)
closes #4618
closes #4641

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-17 15:16:50 -03:00
Carlos Alexandro Becker
280e68431a
test: move test to the right package
refs c9068b4b3c

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-17 14:43:21 -03:00
Maxime Brunet
b614d646ef
feat: support netbsd/arm64 (#4706)
Add support for `goos=netbsd`,`goarch=arm64` build target

Supported since golang/go@d23cba683e. Like
`freebsd/arm64`, it is not documented in the [official
list](https://go.dev/doc/install/source#environment)
2024-03-17 14:35:55 -03:00
Carlos Alexandro Becker
c9068b4b3c
fix: properly template builds.gobinary
closes #4685
2024-03-16 11:50:51 -03:00
Carlos Alexandro Becker
0a272037b3
fix: only build archlinux and aur for supported arches (#4695)
closes #4693

see https://wiki.archlinux.org/title/Frequently_asked_questions
2024-03-16 11:40:57 -03:00
standstaff
994d01a0ce
fix: remove repetitive words (#4701)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

...

<!-- Why is this change being made? -->

...

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...

Signed-off-by: standstaff <zhengxingru@yeah.net>
2024-03-15 09:49:32 -03:00
世界
6f356ffcfa
fix: do not log release published if it is a draft (#4691)
it's a bit scary

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-14 22:47:08 -03:00
Vedant
263cd059f2
feat(winget): update manifest version to 1.6.0 (#4658)
Use the latest schema `1.6.0` available on winget-pkgs.

The new schema supports some new fields, but they do not affect
goreleaser. Hence, this PR is safe to merge, like
https://github.com/goreleaser/goreleaser/pull/4298 was 👍🏻
2024-02-27 09:51:44 -03:00
Carlos Alexandro Becker
4d2bcfdc46
feat(brew): allow to set headers in the url (#4648)
closes  #4647

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-26 17:22:12 -03:00
Oleksandr Redko
305663fb5d
test: simplify error asserts with require.ErrorContains (#4640)
The PR refactors tests:
- change two lines `require.Error + require.Contains` with one
`require.ErrorContains`;
- change `require.Error + require.Equal` with `require.EqualError`.
2024-02-19 16:28:06 -03:00
Kirill Nikolaev
ef90821ee7
feat(pipe/release): Mark GitHub releases as non-draft only after all artifacts are uploaded. (#4626)
Previously end-users would see missing artifacts if trying to use latest
version while artifacts are being uploaded.

This currently applies only to GitHub releases. GitLab does not support
drafts, and I don't dare to make the change for Gitea since I don't use
it (and can't test easily).

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-19 12:50:47 +00:00
Carlos Alexandro Becker
42d2db2021
feat(nfpm): compression, fields, and predends on debs (#4632)
refs #4630

<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

...

<!-- Why is this change being made? -->

...

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-19 08:51:36 -03:00
Carlos Alexandro Becker
d9e9e82ca7
feat(nfpm): also allow $NFPM_PASSPHRASE (#4633)
refs #4630

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-19 08:51:30 -03:00
Oleksandr Redko
a9c76d7655
chore: fix all existing lint issues (#4637)
The PR fixes lint issues, pins `golangci-lint` to `v1.56.2`, disables
`only-new-issues`, and enables `fail-on-issues` in the lint workflow.
After this, all new lint issues will fail CI.

The full log of fixed lint issues:
```sh
❯ golangci-lint run
cmd/docs.go:24:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                RunE: func(cmd *cobra.Command, args []string) error {
                           ^
cmd/man.go:26:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                RunE: func(cmd *cobra.Command, args []string) error {
                           ^
cmd/healthcheck.go:36:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                RunE: func(cmd *cobra.Command, args []string) error {
                           ^
cmd/build.go:72:33: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                RunE: timedRunE("build", func(cmd *cobra.Command, args []string) error {
                                              ^
cmd/schema.go:29:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                RunE: func(cmd *cobra.Command, args []string) error {
                           ^
internal/pipe/nix/nix_test.go:547:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
                                require.ErrorAs(t, err, &tt.expectDefaultErrorIs)
                                ^
internal/pipe/nix/nix_test.go:556:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
                                require.ErrorAs(t, err, &tt.expectRunErrorIs)
                                ^
internal/pipe/nix/nix_test.go:567:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
                                require.ErrorAs(t, err, &tt.expectPublishErrorIs)
                                ^
internal/pipe/winget/winget_test.go:709:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
                                require.ErrorAs(t, err, &tt.expectPublishErrorIs)
                                ^
internal/pipe/winget/winget_test.go:728:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
                                require.ErrorAs(t, err, &tt.expectPublishErrorIs)
                                ^
internal/pipe/docker/docker_test.go:56:29: unused-parameter: parameter 'use' seems to be unused, consider removing or renaming it as _ (revive)
                return func(t *testing.T, use string) {
                                          ^
internal/gio/safe_test.go:23:4: go-require: require must only be used in the goroutine running the test function (testifylint)
                        require.Equal(t, 1, s)
                        ^
internal/gio/safe_test.go:24:4: go-require: require must only be used in the goroutine running the test function (testifylint)
                        require.NoError(t, err)
                        ^
internal/pipe/gomod/gomod_proxy_test.go:126:3: useless-assert: asserting of the same variable (testifylint)
                require.Equal(t, ctx.ModulePath, ctx.ModulePath)
                ^
internal/pipe/gomod/gomod_proxy_test.go:152:3: useless-assert: asserting of the same variable (testifylint)
                require.Equal(t, ctx.ModulePath, ctx.ModulePath)
                ^
internal/pipe/gomod/gomod_proxy_test.go:178:3: useless-assert: asserting of the same variable (testifylint)
                require.Equal(t, ctx.ModulePath, ctx.ModulePath)
                ^
internal/pipe/gomod/gomod_proxy_test.go:239:3: useless-assert: asserting of the same variable (testifylint)
                require.Equal(t, ctx.ModulePath, ctx.ModulePath)
                ^
internal/artifact/artifact_test.go:638:46: unused-parameter: parameter 'a' seems to be unused, consider removing or renaming it as _ (revive)
                require.EqualError(t, artifacts.Visit(func(a *Artifact) error {
                                                           ^
internal/pipe/milestone/milestone.go:79: File is not `gofumpt`-ed (gofumpt)

internal/http/http_test.go:217:19: unused-parameter: parameter 'k' seems to be unused, consider removing or renaming it as _ (revive)
        assetOpen = func(k string, a *artifact.Artifact) (*asset, error) {
                         ^
internal/middleware/logging/logging_test.go:12:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
        require.NoError(t, Log("foo", func(ctx *context.Context) error {
                                           ^
internal/middleware/logging/logging_test.go:16:40: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
        require.NoError(t, PadLog("foo", func(ctx *context.Context) error {
                                              ^
internal/pipe/chocolatey/chocolatey_test.go:277:15: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
                        exec: func(cmd string, args ...string) ([]byte, error) {
                                   ^
internal/client/gitlab.go:325: File is not `gofumpt`-ed (gofumpt)

internal/pipe/linkedin/client_test.go:58:77: unused-parameter: parameter 'req' seems to be unused, consider removing or renaming it as _ (revive)
        server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
                                                                                   ^
internal/middleware/errhandler/error_test.go:15:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.NoError(t, Handle(func(ctx *context.Context) error {
                                               ^
internal/middleware/errhandler/error_test.go:21:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.NoError(t, Handle(func(ctx *context.Context) error {
                                               ^
internal/middleware/errhandler/error_test.go:27:32: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.Error(t, Handle(func(ctx *context.Context) error {
                                             ^
internal/middleware/errhandler/error_test.go:36:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
                                                  ^
internal/middleware/errhandler/error_test.go:42:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
                                                  ^
internal/middleware/errhandler/error_test.go:48:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
                                                  ^
internal/pipe/ko/ko.go:175:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
                build.WithBaseImages(func(ctx stdctx.Context, s string) (name.Reference, build.Result, error) {
                                          ^
```
2024-02-19 08:49:39 -03:00
Oleksandr Redko
dab740dd8f
test(pipe): fix tests cleanup (#4636) 2024-02-17 18:34:22 +00:00
Carlos Alexandro Becker
be511eb341
fix(nix): update licenses 2024-02-12 23:23:48 -03:00
Carlos Alexandro Becker
b33f14c0fa
fix: better universalbinary message (#4627)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

...

<!-- Why is this change being made? -->

...

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-12 22:36:21 -03:00
Carlos Alexandro Becker
c9cc1065b4
chore(deps): update go-github to v59 (#4622)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

...

<!-- Why is this change being made? -->

...

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-09 15:43:19 -03:00
Carlos Alexandro Becker
e43604f4a0
feat: use go 1.22 (#4614)
- use go 1.22

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-02-09 09:57:38 -03:00
Brian Strauch
306999b78b
fix: sort order of brew artifacts (#4617)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

Fix the order in which brew artifacts are sorted.

<!-- Why is this change being made? -->

* The order occasionally switches, which results in a larger diff:
https://github.com/confluentinc/homebrew-tap/pull/41
* The artifacts are already grouped by OS before `lessFnFor()` is
called, so `list[i].OS > list[j].OS` always evaluates to `false` and the
order remains unchanged. This PR removes that statement.
* It looks like a `map` is used earlier, while filtering the artifacts,
which might explain why the order occasionally switches.
* Update the remaining statement in `lessFnFor()` to actually use `<` as
the function suggests.

<!-- # Provide links to any relevant tickets, URLs or other resources
-->
2024-02-09 08:12:02 -03:00
actions-user
4f2dc3c569 chore: docs auto-update 2024-02-05 12:39:29 +00:00
Carlos Alexandro Becker
6f72ac3459
fix: improve linkedin error message
refs https://github.com/goreleaser/goreleaser/issues/4421
2024-02-01 22:56:04 -03:00
Carlos Alexandro Becker
b294759d95
feat(nfpm): add .Format tmpl var
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-31 07:31:21 -03:00
Carlos Alexandro Becker
765d534c2e
feat(nfpm): support libraries (#4587)
This adds `nfpm.libdirs` to allow to set where to put libraries built,
as well as include them in the search for artifacts when building the
package.

closes #4346

---

PS: I'm not sure about the default dirs, let me know what you think!

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-31 07:26:25 -03:00
Carlos Alexandro Becker
d5b6a533ca
Merge pull request from GHSA-h3q2-8whx-c29h
this could potentially leak environment variables.

closes GHSA-h3q2-8whx-c29h

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-29 20:53:46 -03:00
Carlos Alexandro Becker
ee7a1e66ab
feat(artifactory): publish source archives too, log when no archives found (#4586)
Logs when no artifacts were found, and also allow to publish source
archives.

refs https://github.com/orgs/goreleaser/discussions/4585

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-29 16:29:49 -03:00
Aaron U'Ren
917cae54f0
fix(config): handle relative git repos (#4575)
## If applied, this commit will...

If applied this change will allow goreleaser to handle relative remotes
when attempting to parse a repo URL from git.

## Why is this change being made? 

To fix the error that I recently came across while trying to test my
goreleaser configuration:

```
% goreleaser check
  • checking                                 path=
  ⨯ configuration is invalid                 error=invalid scm url: .
  ⨯ .goreleaser.yml                                  error=configuration is invalid: invalid scm url: .
  ⨯ command failed                                   error=1 out of 1 configuration file(s) have issues
```

This change happened while on a branch doing some development. As part
of that development I needed to test a change to my goreleaser config.

My git config at the time looked like (repo obfuscated):

```
% cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@gitlab.com:some/repo
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[branch "release_fixes"]
        remote = .
        merge = refs/heads/main
```

It is fairly common for git to add remotes with a `.` when branch
tracking is enabled.

While, in general, there aren't many use cases that require a user to
need to release from a non-primary branch, there are cases where the
user may want to test their configuration with `goreleaser check` and
the error of `invalid scm url: .` isn't very helpful.

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-29 10:31:19 -03:00
Carlos Alexandro Becker
da30c39ccb
fix(nix): prevent importing makeWrapper when it's not needed
refs 7f95ff0a9a

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-27 09:12:55 -03:00
Carlos Alexandro Becker
7f95ff0a9a
fix(nix): improve generated derivations (#4582)
- use stdenvNoCC instead of pkgs.stdenvNoCC
- always include stdenvNoCC, even if no deps
- use stdenvNoCC.is(Darwin/Linux) instead of stdenv's

refs #4358
refs 003a8815

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-27 09:01:00 -03:00
Carlos Alexandro Becker
2ced7acdd9
fix(docker): remove --builder=default from default args when use=buildx (#4566)
refs #4392

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-22 20:27:40 -03:00
Carlos Alexandro Becker
bfa9e7fd17
refactor(winget): improve winget code
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-21 23:09:32 -03:00
Eng Zer Jun
1d44832f6b
refactor(http): remove redundant nil check (#4563)
From the Go specification [^1]:

> "3. If the map is nil, the number of iterations is 0."

Therefore, it is not required to do a nil check for the map before the
loop.

[^1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-01-21 21:51:03 -03:00
Carlos Alexandro Becker
6097ea50f5
fix: possible nil pointers on logs
refs https://github.com/goreleaser/goreleaser/pull/3966/files#r1460694856

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-21 21:46:59 -03:00
Carlos Alexandro Becker
ac398de727
fix(brew): improve handling of single os (#4562)
- refactors brew template into separated files using embed.FS
- moves the macos and linux packages to different template files 
- includes and indent those accordingly to which OSes are supported

closes #4561

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-19 12:41:28 -03:00