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>
This will also come in handy for multiple languages support (#5307).
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
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.
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>
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
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=."))
^
```
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>
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)
```
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.
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.
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>
Since Go386 now has a default value, existing configurations no longer
match 386 builds (d583861e0606f2bb9e97c0d0e28f9b82df6a187a).
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)