1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-18 03:56:52 +02:00

146 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
e8da87cecb
feat(tmpl): IsSingleTarget (#5122)
refs #5024

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-07 11:09:21 -03:00
Carlos Alexandro Becker
96c87fff72
fix: build --single-target filters (#5114)
make them more precise, as its currently only taking GOOS/GOARCH into
account, and we can do more.

closes #5112

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-04 10:10:27 -03:00
Carlos Alexandro Becker
94a8de5347
build: use go 1.23 (#5082)
update everything to go 1.23

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-18 16:08:55 -03:00
Carlos Alexandro Becker
2de792c31d
feat: rename snapshot.name_template -> snapshot.version_template (#5019)
close #5017

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-29 09:21:00 -03:00
Carlos Alexandro Becker
700ff34236
docs: improving docs (#4956)
slowly but steadily fixing a billion warnings
2024-07-08 23:30:10 -03:00
Carlos Alexandro Becker
0d1e3c023f
fix: moving some logs to debug 2024-06-22 22:43:57 -03:00
Carlos Alexandro Becker
f5c4fce822
feat: build --auto-snapshot (#4917)
closes #4891
2024-06-11 09:34:41 -03:00
Carlos Alexandro Becker
a312cf3d0b
test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-03 22:12:04 -03:00
Carlos Alexandro Becker
ec2db4a727
feat!: rename module to /v2 (#4894)
<!--

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-05-26 15:02:57 -03:00
Carlos Alexandro Becker
b6b2df6312
feat!: more v2 cleanups (#4892)
<!--

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-05-25 15:04:08 -03:00
Carlos Alexandro Becker
4fa8df6413
feat!: v2 (#4806)
BREAKING CHANGE

removed all deprecated options, config file should now have a `version:
2` bit


![Dont
Matter](https://github.com/goreleaser/goreleaser/assets/245435/31ece16a-cb70-4e43-9caa-8364e73fbeb9)

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-25 14:09:49 -03:00
Carlos Alexandro Becker
7e0155c557
fix: disable logs on some commands (#4865)
closes #4864

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-15 10:13:43 -03:00
Carlos Alexandro Becker
e466507637
fix(cmd): --draft should only override if set
closes #4862

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-14 22:47:51 -03:00
Oleksandr Redko
6505654c86
fix: fix nolintlint issues (#4854)
The PR enables
[`nolintlint`](https://golangci-lint.run/usage/linters/#nolintlint)
linter and fixes up appeared issues.

Changes:

- Enable `nolintlint` in `.golangci.yml` config.
- Remove unused `//nolint:` comments.
- Fix `nolint` comment format by removing spaces (`// nolint: dupl` ->
`//nolint:dupl`)

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-12 14:11:11 -03:00
John Taylor
e21a99a54b
docs: improve -p help message (#4798)
I just improved the verbiage of the `build -p` switch:

from: `Amount tasks to run concurrently (default: number of CPUs)`

to: `Number of tasks to run concurrently (default: number of CPUs)`
2024-04-22 23:13:37 -03:00
Carlos Alexandro Becker
c1615ea521
feat(cmd): release --draft (#4771)
closes #4767

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-12 11:08:58 -03:00
Hugo Hromic
bf79c2cf91
fix: use correct path variable for logging in check command (#4756)
This trivial PR fixes a minor cosmetic issue in the `check` command.

Before this fix, GoReleaser would not show the auto-detected config path
under check when no args are provided:
```
$ goreleaser check
  • checking                                 path=
  • 1 configuration file(s) validated
  • thanks for using goreleaser!
```

After this check, GoReleaser correctly shows any auto-detected config
paths:
```
$ goreleaser check
  • checking                                 path=.goreleaser.yaml
  • 1 configuration file(s) validated
  • thanks for using goreleaser!
```
2024-04-04 09:32:05 -03:00
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
a00bf7e5d6
feat: support .config dir
closes #4716

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-26 23:39:05 -03:00
Carlos Alexandro Becker
9ee0185478
Merge remote-tracking branch 'origin/main' 2024-03-16 14:38:17 -03:00
Carlos Alexandro Becker
566e99ad73
feat: fig is being sunset, remove (#4694)
see https://fig.io
2024-03-13 08:50:40 -03:00
Carlos Alexandro Becker
3ed614d316
test: fix error message 2024-03-03 14:52:58 -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
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
Carlos Alexandro Becker
12469c4251
feat: store which action is being taken in the context (#4508)
refs #4504

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-12-29 15:22:03 -03:00
Carlos Alexandro Becker
c567f15ad7
test: improve test 2023-11-29 23:12:16 -03:00
Carlos Alexandro Becker
25a054c5e1
feat: improve --single-target (#4442)
closes #4437 
closes #4426

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-11-27 18:29:50 -03:00
Carlos Alexandro Becker
e33d053612
fix: --single-target when no match
closes #4412
2023-11-08 02:02:49 +00:00
Carlos Alexandro Becker
c0b2be344f
fix: handle configs with no explicit targets on --single-target
closes #4411
2023-11-07 11:40:31 +00:00
Carlos Alexandro Becker
8248526512
chore: remove temporary log 2023-10-17 15:52:52 +00:00
Carlos Alexandro Becker
95c990b166
fix: build --single-target (#4370)
closes #4369
2023-10-14 18:58:03 -03:00
Carlos Alexandro Becker
74eba9ee16
fix: skips log on goreleaser build
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-23 05:36:31 +00:00
Carlos Alexandro Becker
41c21dc38f
fix: only log skips if something is actually being skipped 2023-09-23 04:28:03 +00:00
Carlos Alexandro Becker
08d63aa5ff
fix(skips): print all steps that will be skipped 2023-09-20 15:03:46 +00:00
Carlos Alexandro Becker
0337a0b3a8
refactor: improve --skip completions
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-17 03:00:15 +00:00
Carlos Alexandro Becker
622c426eb3
refactor: --skip=item (#4272)
Laying the ground work to allow skipping more pipes without adding new
flags et al.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-16 17:01:20 -03:00
Carlos Alexandro Becker
da380cc9a7
fix: improve check/load config logs
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-18 21:47:18 +00:00
Carlos Alexandro Becker
f0d0cac469
feat: update to go 1.21 (#4244)
update to go 1.21

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-15 11:15:04 -03:00
Carlos Alexandro Becker
bbe2ee7bfb
refactor: properly annotate deprecated options
Removed unused, deprecated stuff.
2023-08-04 14:47:54 +00:00
Carlos Alexandro Becker
4266634752
feat: improve output (#4206)
- improves deprecation warning styles a bit so they caught the readers
eye faster and are easier to read
- warns if the user uses `builds.target` in conjunction with other
options which are ignored in that case
- improved env output
- improved no configuration found warning

some of the changes:

<img width="1263" alt="CleanShot 2023-07-24 at 21 38 41@2x"
src="https://github.com/goreleaser/goreleaser/assets/245435/40465853-7177-44d6-b07b-61b67590669a">

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-25 08:26:44 -03:00
Carlos Alexandro Becker
2a3009757a
test: fix init test
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-19 00:52:11 +00:00
Carlos Alexandro Becker
498931561d
feat: init improvements
- do not override an existing configuration file
- do not add `dist/` to the `.gitignore` if it already contains it

closes #4162
2023-07-18 12:21:09 +00:00
Carlos Alexandro Becker
7eb6af3839
fix: properly log file with issues on check 2023-07-11 18:25:33 +00:00
Carlos Alexandro Becker
9364d9983a
fix: improve log 2023-07-04 12:34:59 +00:00
Eng Zer Jun
73e59160de
test: use t.Setenv to set env vars (#4140)
We have been using `t.Setenv` is most of our tests. This PR replaces the
remaining `os.Setenv` with `t.Setenv`.

Reference: https://pkg.go.dev/testing#T.Setenv

```go
func TestFoo(t *testing.T) {
	// before
	os.Setenv(key, "new value")
	defer os.Unsetenv(key)
	
	// after
	t.Setenv(key, "new value")
}
```

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-25 09:54:10 -03:00
Carlos Alexandro Becker
72cf8404c1
feat: continue on error (#4127)
closes #3989

Basically, when some of these pipes fail, the error will be memorized,
and all errors will be thrown in the end.

Meaning: the exit code will still be 1, but it'll not have stopped in
the first error.

Thinking of maybe adding a `--fail-fast` flag to disable this behavior
as well 🤔

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-20 09:33:59 -03:00
Ville Skyttä
1c9b4d56b4
feat: completion improvements (#4071)
See individual commits for details.
2023-06-06 00:21:17 -03:00
Carlos Alexandro Becker
d0cf457136
feat: improve verbose output (#4017)
- deprecates `--debug` in favor of `--verbose` which is clearer 
- improved some debug log outputs
- docs: update documentation to always use the `release` subcommand
(when it makes sense)
2023-05-27 00:18:39 -03:00
Carlos Alexandro Becker
950cebee57
fix(cmd): check with no args 2023-05-24 03:32:37 +00:00
Carlos Alexandro Becker
cebdf0d8a6
fix: goreleaser build index out of range (#4007)
If you run `goreleaser build --single-target` with
`universalbinaries[*].replace = true` on a mac, it'll break.

This fixes it by disabling universal binaries when building a single
target.

It isn't useful anyway.

Closes #4004

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-12 15:50:12 -03:00