1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-01 00:54:57 +02:00

1700 Commits

Author SHA1 Message Date
a7b8cb0a4c fix: targets 2024-12-01 18:36:17 -03:00
79d89cb0ec fix: better error handling 2024-12-01 17:52:13 -03:00
570af99efe fix: names 2024-12-01 15:07:46 -03:00
003e41cb77 feat(build): rust support 2024-12-01 15:06:42 -03:00
b623d53583 fix: lint 2024-11-29 15:34:07 -03:00
8f0cede737 fix(build): improve build overrides handling
- jsonschema: make both goos and goarch mandatory
- log.warn if any of them are empty
- log.debug when it doesn't match

refs #5322
2024-11-29 15:05:42 -03:00
f1a364726d fix: docker error message 2024-11-29 10:26:48 -03:00
afd6d02101 chore(deps): update go-github to v67 2024-11-29 00:39:56 -03:00
6d1429da72 fix(lint): ignore error copying to discard 2024-11-28 22:57:54 -03:00
65a945e82c test: fix static config test 2024-11-28 22:57:44 -03:00
c7f4e903e7 fix(announce): move default status codes to Default, more tests
building on #5317
2024-11-28 22:53:21 -03:00
77bbddf64b feat(announce): implement expected_status_codes for webhooks (#5317)
fixes #5316
2024-11-28 22:46:55 -03:00
898c62c690 fix: artifact filter should check if default when builder is zig
It shouldn't happen, but this makes it a bit safer.
2024-11-28 22:14:58 -03:00
e6dc91cf05 feat(init): figure out if its a zig project, init differntly
This will use a different example configuration file on `goreleaser
init` if the project is likely a zig project (i.e. contains a
`build.zig`).
2024-11-28 22:05:50 -03:00
f34093d345 feat(init): add footer to default configuration file 2024-11-28 21:39:57 -03:00
09be848e1a feat(build): initial support for zig (#5312)
Continuing on #5308 and #5307, this finally adds Zig support to
GoReleaser!

Things are very raw still, plenty of use cases to test (please do test
on your project if you can), but it does work at least for simple
projects!

A release done by this:
https://github.com/goreleaser/example-zig/releases/tag/v0.1.0

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-28 08:47:20 -03:00
f247d7d38c feat(template): allow to use .Target (#5308)
This will also come in handy for multiple languages support (#5307).

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-25 23:41:00 -03:00
d43f84aa3f refactor(build): preparing to support multiple languages (#5307)
This starts laying the foundation for supporting more languages, the
first of which will probably be Zig, and then Rust.

I already have a zig prototype working in another branch, just raw
dogged it to see if it would work, and since it does, now I'll do it
piece by piece but with hopefully slightly better code.
2024-11-25 23:00:28 -03:00
2758964617 fix: lint issue
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-25 00:57:39 -03:00
377981ebd7 fix(aur): description with quotes (#5304)
Currently, the field `pkgdesc` is wrapped by simple quotes, but if the
description also contains simple quotes it breaks the package.

So it's not possible to publish a package that contains "Let's Encrypt"
inside the description.

This PR wraps the description with the right quotes depending on the
description content.

If there is a mix of quotes, it replaces, arbitrarily, double quotes
with single quotes.

Example with double quotes inside the description:
https://gitlab.archlinux.org/archlinux/packaging/packages/cargo-release/-/blob/main/PKGBUILD?ref_type=heads

Example with simple quotes inside the description:
https://gitlab.archlinux.org/archlinux/packaging/packages/cargo-modules/-/blob/main/PKGBUILD?ref_type=heads
2024-11-22 09:56:52 -03:00
ed94f0d386 test(ko): update chainguard labels 2024-11-21 21:12:52 -03:00
10ab79f858 fix(build): overrides without specifying goarm64 et al (#5298)
this will use the default value for GOMIPS, GOARM, GO386, and etc in
build overrides if they are not specified.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-21 21:09:59 -03:00
ae4f6aa662 refactor: replace fmt.Errorf with errors.New for consistency (#5294)
The PR replaces usages of `fmt.Errorf` with `errors.New` for creating
errors. Enables `perfsprint` linter to prevent future regressions.
2024-11-18 14:07:22 -03:00
bae3bacc7d refactor: use cmp.Or instead of ordered.First (#5295)
This PR replaces usages of
[`ordered.First`](https://pkg.go.dev/github.com/charmbracelet/x/exp/ordered#First)
with [`cmp.Or`](https://pkg.go.dev/cmp#Or). No need to use an external
library when the same functionality is present in stdlib.

You can compare implementations:
[ordered.First](https://github.com/charmbracelet/x/blob/exp/ordered/v0.1.0/exp/ordered/ordered.go#L31)
vs
[cmp.Or](https://cs.opensource.google/go/go/+/refs/tags/go1.23.3:src/cmp/cmp.go;l=69).

Additional reading
https://blog.carlana.net/post/2024/golang-cmp-or-uses-and-history/
2024-11-18 14:05:41 -03:00
700889269f fix: no output
In the windows support efforts, accidentally started using testlib in
production code.

`testlib` disables log output on `init`, which was causing the issue.

fixed the usage, and added a panic if `testlib` is used outside of
tests.

closes #5292
2024-11-18 07:53:42 -03:00
bb438ba34e test: fix build test 2024-11-16 11:14:59 -03:00
3c55f2bb77 test: improving tests on windows
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-16 10:57:48 -03:00
0832d81c2d chore(aur): remove dead code about armv6 (#5280)
Follows https://github.com/goreleaser/goreleaser/pull/4695, remove dead
code about armv6.
2024-11-16 10:31:48 -03:00
bc32cd6fbf ci: update golangci-lint to v1.62 (#5288)
This PR updates the version of golangci-lint to the latest
[v1.62](https://github.com/golangci/golangci-lint/releases/tag/v1.62.0)
and fixes appeared lint issues:

```
❯ golangci-lint run
internal/archivefiles/archivefiles.go:144:2: redefines-builtin-id: redefinition of the built-in function min (revive)
        var min int
        ^
internal/archivefiles/archivefiles.go:146:3: redefines-builtin-id: redefinition of the built-in function min (revive)
                min = len(b)
                ^
internal/archivefiles/archivefiles.go:148:3: redefines-builtin-id: redefinition of the built-in function min (revive)
                min = len(a)
                ^
cmd/root.go:152:29: redefines-builtin-id: redefinition of the built-in type rune (revive)
func timedRunE(verb string, rune func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error {
                            ^
internal/git/config_test.go:39:2: contains: use require.Contains (testifylint)
        require.True(t, strings.Contains(gitCfg, "branch.relative_branch.remote=."))
        ^
```
2024-11-16 10:31:22 -03:00
2bf08f11a6 ci: run build/test workflow on windows too (#5263)
Maybe 3rd time is the charm!

This makes the CI build run on windows too, and fix broken tests/featuers on Windows.

Most of the changes are related to ignoring certain tests on windows, or making sure to use the right path separators.

More work to do in the future, probably!

#4293

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-16 10:30:39 -03:00
c65b2258cb fix: pass context.Context to HTTP requests (#5289)
This PR adds using `context.Context` in HTTP requests. Changes are
similar to #5232.

Additionally, it enables `noctx` to automatically detect missing
context:
```
internal/pipe/webhook/webhook.go:85:29: should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx)
internal/pipe/linkedin/client.go:68:27: (*net/http.Client).Get must not be called (noctx)
internal/pipe/linkedin/client.go:101:27: (*net/http.Client).Get must not be called (noctx)
internal/pipe/linkedin/client.go:172:28: (*net/http.Client).Post must not be called (noctx)
```
2024-11-16 10:16:54 -03:00
ede5a9fea6 fix: typo in the git SSH command constant (#5287) 2024-11-15 19:02:04 -03:00
fac5e48c77 fix: URL escape tags in github, gitlab, and gitea (#5283)
refs #5282
2024-11-15 10:39:05 -03:00
82fd112f77 chore: auto-update generated files 2024-11-14 15:08:14 +00:00
efe8b7089e refactor: remove an unneeded condition
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-13 09:11:21 -03:00
297615b9b7 refactor: improve a bit the git changeloger
also explained things a bit more

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-13 09:09:26 -03:00
ebe225a80b fix(changelog): fix for no tags (#5272)
this should help when there is no tags in the repo yet

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-13 09:01:48 -03:00
f54fb113ee test: fix broken Docker tests
seems to be something new on recent docker versions...

closes #5269
2024-11-12 16:08:32 -03:00
5a1353ddfa test: remove redundant os.Exit in TestMain (#5257)
This PR simplifies tests by removing redundant `os.Exit` calls in
`TestMain` functions.

As of Go 1.15, we do not need to call `os.Exit(m.Run())` explicitly, as
value returned by `m.Run()` is stored into unexported field of `m` and
go test executable is smart enough to automatically call
`os.Exit(retValue)` when `TestMain` returns. See golang/go#34129.
2024-11-09 15:10:14 -03:00
2b76fb266f test: remove redundant require.Error (#5253)
The PR refactors tests by removing redundant `require.Error` statements
that are followed by `require.ErrorContains`. `require.ErrorContains`
will fail if `err` is `nil`, so `require.Error` is not needed.
2024-11-06 22:16:31 -03:00
1e80f5f5b7 chore: fix typos in test names (#5249)
The PR corrects grammar mistakes in test names.
2024-11-06 14:54:56 -03:00
8dad0d8229 docs: fix typos in comments (#5246) 2024-11-05 20:28:16 -03:00
606c0e724f fix(cmd): handle --skip=,names...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-04 23:08:34 -03:00
cc4427f346 chore: auto-update generated files 2024-11-04 18:20:39 +00:00
9a68c54d53 fix(changelog): first release default to git changelogger (#5242)
the `/compare` api doesn't allow to omit the previous reference, nor to
use a git commit, so, if `previous tag` is empty, we're now defaulting
to the git changelog implementation, which should resolve the problem.

closes #5240

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-04 14:13:30 -03:00
a8315bca8f fix: missing equal sign in environment variable
closes #5241
2024-11-04 12:35:50 -03:00
cb8997e76b fix: goreleaser build --single-target on arm64
refs https://github.com/goreleaser/goreleaser/issues/5238#issuecomment-2454334189
2024-11-04 08:51:43 -03:00
a4ead4ba28 fix: build override consider goarm64
plus more tests
2024-11-04 08:27:09 -03:00
6ef6623d46 fix: build override (#5239)
Since Go386 now has a default value, existing configurations no longer
match 386 builds (d583861e06).

Since we used to need to write goamd64=1 to match _amd64 builds, I added
new opts to fix that. (If you think you need to set some default for
override, that would be even better)
2024-11-04 08:11:52 -03:00
1b1a2be4c8 chore: auto-update generated files 2024-11-02 18:20:48 +00:00