1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

1187 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
a7b8cb0a4c
fix: targets 2024-12-01 18:36:17 -03:00
Carlos Alexandro Becker
79d89cb0ec
fix: better error handling 2024-12-01 17:52:13 -03:00
Carlos Alexandro Becker
003e41cb77
feat(build): rust support 2024-12-01 15:06:42 -03:00
Carlos Alexandro Becker
f1a364726d
fix: docker error message 2024-11-29 10:26:48 -03:00
Carlos Alexandro Becker
6d1429da72
fix(lint): ignore error copying to discard 2024-11-28 22:57:54 -03:00
Carlos Alexandro Becker
c7f4e903e7
fix(announce): move default status codes to Default, more tests
building on #5317
2024-11-28 22:53:21 -03:00
Matt Robenolt
77bbddf64b
feat(announce): implement expected_status_codes for webhooks (#5317)
fixes #5316
2024-11-28 22:46:55 -03:00
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
Ludovic Fernandez
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
Carlos Alexandro Becker
ed94f0d386
test(ko): update chainguard labels 2024-11-21 21:12:52 -03:00
Oleksandr Redko
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
Oleksandr Redko
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
Carlos Alexandro Becker
bb438ba34e
test: fix build test 2024-11-16 11:14:59 -03:00
Carlos Alexandro Becker
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
Ludovic Fernandez
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
Carlos Alexandro Becker
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
Oleksandr Redko
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
actions-user
82fd112f77 chore: auto-update generated files 2024-11-14 15:08:14 +00:00
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
Oleksandr Redko
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
Oleksandr Redko
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
Oleksandr Redko
1e80f5f5b7
chore: fix typos in test names (#5249)
The PR corrects grammar mistakes in test names.
2024-11-06 14:54:56 -03:00
Oleksandr Redko
8dad0d8229
docs: fix typos in comments (#5246) 2024-11-05 20:28:16 -03:00
actions-user
cc4427f346 chore: auto-update generated files 2024-11-04 18:20:39 +00:00
Carlos Alexandro Becker
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
Carlos Alexandro Becker
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
actions-user
1b1a2be4c8 chore: auto-update generated files 2024-11-02 18:20:48 +00:00
Carlos Alexandro Becker
e0a21a1f5d
fix(nfpm): bad filename for 386
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-02 15:08:58 -03:00
Carlos Alexandro Becker
1455d462f1
test(nfpm): goppc64, goriscv64, etc 2024-11-02 13:58:05 -03:00
Carlos Alexandro Becker
f65c757073
fix(nfpm): wrong filename for arm64
refs #5186
closes #5238
2024-11-02 13:50:41 -03:00
Oleksandr Redko
12155a336b
refactor: remove empty lines, fix //nolint (#5235)
The PR formats code by removing redundant empty lines and fixes
`//nolint` directives. Additionally, this PR adds two more rules to the
`revive` configuration: `empty-lines` and `comment-spacings`.

Removing unnecessary empty lines helps to keep the codebase clean and
concise. This issue is identified by the `revive.empty-lines` rule.

In the `//nolint` directive, there must be no spaces between `:` and the
linter name: `//nolint:gosec`. See ["Nolint
Directive"](https://golangci-lint.run/usage/false-positives/#nolint-directive).
This issue is identified by the `revive.comment-spacings` rule.

Note that it's not possible to add just a few additional rules to the
`revive.enable` list. We need to specify all: default rules plus
additional rules. See the detailed explanation
[here](https://github.com/prometheus/prometheus/pull/13068).
2024-10-31 13:51:54 -03:00
Oleksandr Redko
b269cc9229
feat: use context for HTTP request in discord (#5232)
The PR adds using `context.Context` in the `POST` request.

Context is a request scoped paradigm according to [the
doc](https://pkg.go.dev/context).

The PR adds `API` field into the `Config` for utilizing it in tests.
2024-10-31 08:57:46 -03:00
Oleksandr Redko
57365c1630
refactor: rename archive.Copying to archive.Copy (#5233)
This PR renames `Copying` functions in the `archive` package to `Copy`
because it is a more common method name.
2024-10-31 08:53:27 -03:00
Maxime Brunet
d722aac36b
feat(ko): support annotations and user (#5227)
Add support for the newly added annotations and user options in [ko
v0.17.0](https://github.com/ko-build/ko/releases/tag/v0.17.0)
2024-10-27 16:01:09 -03:00
Carlos Alexandro Becker
244bbf0afe
fix: quill dependency conflics
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-10-26 14:05:40 -03:00
Carlos Alexandro Becker
d7b2554312
test(ko): fix chainguard/static labels
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-10-26 13:58:18 -03:00
Oleksandr Redko
0f48a6dd40
refactor: use std maps,slices instead of golang.org/exp (#5221)
The PR refactors code by replacing usage of
`golang.org/exp/slices`/`golang.org/exp/maps` package with the standard
`slices`/`maps`. Additionally, replace the function `keys(someMap)` with
`slices.Compact(maps.Keys(someMap))`

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-10-25 11:38:55 -03:00
Carlos Alexandro Becker
66db8c0857
fix: build 386 2024-10-15 15:28:52 -03:00
Carlos Alexandro Becker
24c6060050
fix: standardize .Ext to always have the preceding . (#5207)
historically this is kind of a mess, some places set the prefixed ext
(e.g. `.exe`) others don't (e.g. `msi`)

this standardize it to have the preceding `.`

also makes `ByExt` works with or without it so it doesn't break anyone's
config.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-10-15 14:57:27 -03:00
Carlos Alexandro Becker
d583861e06
feat(build): add GO386, GOMIPS64, GORISCV64, and GOPPC64 support (#5186)
continuing the work of #5153

closes #5153

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: 世界 <i@sekai.icu>
2024-10-14 09:40:10 -03:00
Paul Querna
47212a5410
fix(brew): Fix Forumla Class Name builder (#5192)
- Fixes #5191 
- I added a test case, but I don't have a great mechanism to test this
fully in a live environment.

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-10-11 11:59:47 -03:00
Eng Zer Jun
b2a02b582f
fix(changelog): fix random order of first commit in first release (#5173)
## Background

This is a bug that occurs randomly under a very specific condition.

Not sure how long this bug has been around. I first noticed it in the
failed Dagger test job in
https://github.com/goreleaser/goreleaser/pull/5161 after the `TestGroup`
unit test was updated to use regex matching
https://github.com/goreleaser/goreleaser/pull/5161#discussion_r1781302054.

Log:
https://github.com/goreleaser/goreleaser/actions/runs/11108665571/job/30862144417#step:4:680

```
--- FAIL: TestGroup (0.23s)
    changelog_test.go:843: 
        	Error Trace:	/src/internal/pipe/changelog/changelog_test.go:843
        	Error:      	Expect "## Changelog
        	            	### Features
        	            	* a77c0b89a457ee6a78447f6c9113b79cf4dce8ce feat: added that thing
        	            	### Bug Fixes
        	            	* 3e2908a87e5fdfdbd5efaad013c0b2d196c64c40 bug: Merge pull request #999 from goreleaser/some-branch
        	            	### Bots
        	            	* e2b7fbaaf1387cd4af575f5e329d9441ce1a917b feat(deps): update foobar [bot]
        	            	### Others
        	            	* 3643389d7150dc191eca4ac8428274fb31213a12 this is not a Merge pull request
        	            	* 3e1421263cd99fbd9a1a6c0196a355efe96e631d chore: something about cArs we dont need
        	            	* c094f150bc948d76f920219ef9729fd63747324b docs: whatever
        	            	* 242178ede64b3ff570dfbde6416f2c4718dd5b68 fix: whatever
        	            	* 02b7e77076dfed7475d42d728d69d13d19a10a39 ignored: whatever
        	            	* c3b78e347e5c38acc6b78e5a963b28221ac0cfee fixed bug 2
        	            	* fc5f56a9d915d19bc3630dc40aabd99a3eede02b added feature 1
        	            	* dc67ddaae25db36fe70d3b96311243621c176169 first
        	            	" to match "## Changelog
        	            	### Features
        	            	\* \w+ feat: added that thing
        	            	### Bug Fixes
        	            	\* \w+ bug: Merge pull request #999 from goreleaser\/some-branch
        	            	### Bots
        	            	\* \w+ feat\(deps\): update foobar \[bot\]
        	            	### Others
        	            	\* \w+ first
        	            	\* \w+ this is not a Merge pull request
        	            	\* \w+ chore: something about cArs we dont need
        	            	\* \w+ docs: whatever
        	            	\* \w+ fix: whatever
        	            	\* \w+ ignored: whatever
        	            	\* \w+ fixed bug 2
        	            	\* \w+ added feature 1
        	            	"
        	Test:       	TestGroup
```


Then it also failed in:

1. 71e7a63ca111d184ac9ab3f68187b12c63b2c13e

Log:
https://github.com/goreleaser/goreleaser/actions/runs/11166871425/job/31041794426#step:4:667

```
--- FAIL: TestGroup (0.13s)
    changelog_test.go:843: 
        	Error Trace:	/src/internal/pipe/changelog/changelog_test.go:843
        	Error:      	Expect "## Changelog
        	            	### Features
        	            	* 7a9c58e3f299b347754c02a149f77d4450768aba feat: added that thing
        	            	### Bug Fixes
        	            	* 9d5982da0fa36817c9c907271ece0a238bc24918 bug: Merge pull request #999 from goreleaser/some-branch
        	            	### Bots
        	            	* 6890859be3907f8f1b60b1a82cb4af277a0bc425 feat(deps): update foobar [bot]
        	            	### Others
        	            	* 6acc3600c5fe17d0330b566e6d5703e48725f300 this is not a Merge pull request
        	            	* 31abf613e4c3a5fcaebb0a1a23bcd418d61d2c4d first
        	            	* 14a53e66c59c532a81e729b6717aa4137cc292fb chore: something about cArs we dont need
        	            	* df77c2f0d8b1bbdc697e843e1dd2764a716a2aa5 docs: whatever
        	            	* a4802f6fc858cbc12ceca360a89894a61a0a097f fix: whatever
        	            	* 7a2645a1262516ca24443a65c137680e2e3857fc ignored: whatever
        	            	* b66e319579a7eeb319d1d2a95cb938d6316d3edb fixed bug 2
        	            	* 377012fb77758238b46a20c8bbd348e55d011168 added feature 1
        	            	" to match "## Changelog
        	            	### Features
        	            	\* \w+ feat: added that thing
        	            	### Bug Fixes
        	            	\* \w+ bug: Merge pull request #999 from goreleaser\/some-branch
        	            	### Bots
        	            	\* \w+ feat\(deps\): update foobar \[bot\]
        	            	### Others
        	            	\* \w+ first
        	            	\* \w+ this is not a Merge pull request
        	            	\* \w+ chore: something about cArs we dont need
        	            	\* \w+ docs: whatever
        	            	\* \w+ fix: whatever
        	            	\* \w+ ignored: whatever
        	            	\* \w+ fixed bug 2
        	            	\* \w+ added feature 1
        	            	"
        	Test:       	TestGroup
```

2. 747c11d83301405c40df3a5b56adf976c8382b0f

Log:
https://github.com/goreleaser/goreleaser/actions/runs/11166873534/job/31041800714#step:4:677

```
--- FAIL: TestGroup (0.09s)
    changelog_test.go:843: 
        	Error Trace:	/src/internal/pipe/changelog/changelog_test.go:843
        	Error:      	Expect "## Changelog
        	            	### Features
        	            	* 49f56e2d8ca352d4641828efd167dbfe91f5769a feat: added that thing
        	            	### Bug Fixes
        	            	* 11c8dafa67d5973c359ed3bcf859b81d571396ed bug: Merge pull request #999 from goreleaser/some-branch
        	            	### Bots
        	            	* df888fe601a92afe5d8d4fcae5a551b0eaa57684 feat(deps): update foobar [bot]
        	            	### Others
        	            	* 03f397c28cd4f5484afee71f7edd99977f85deec this is not a Merge pull request
        	            	* 16333c2d178e4911a049ba63b0b8783bbc7e497b chore: something about cArs we dont need
        	            	* e7b30e58579bdaaeea184d78ddb5017a2bdc3459 docs: whatever
        	            	* ab9abbc7aa88208f2b3dc44dc9f7b0e55771b826 fix: whatever
        	            	* 87fc355911ca94f0a1e5a6c332e36b1f73654fbe ignored: whatever
        	            	* 189fa3fb4ceb246084404247ad1b521747f30991 fixed bug 2
        	            	* 49fdca4fd96ec600d79722f3453c1b84e82dd6e5 added feature 1
        	            	* ea1e16eb97b432d9c111df934ea4b6ce3691438a first
        	            	" to match "## Changelog
        	            	### Features
        	            	\* \w+ feat: added that thing
        	            	### Bug Fixes
        	            	\* \w+ bug: Merge pull request #999 from goreleaser\/some-branch
        	            	### Bots
        	            	\* \w+ feat\(deps\): update foobar \[bot\]
        	            	### Others
        	            	\* \w+ first
        	            	\* \w+ this is not a Merge pull request
        	            	\* \w+ chore: something about cArs we dont need
        	            	\* \w+ docs: whatever
        	            	\* \w+ fix: whatever
        	            	\* \w+ ignored: whatever
        	            	\* \w+ fixed bug 2
        	            	\* \w+ added feature 1
        	            	"
        	Test:       	TestGroup
```

3. 10980311a53bf90e3d5d469a9c3e916d67c0050d

Log:
https://github.com/goreleaser/goreleaser/actions/runs/11183904433/job/31093519567#step:14:41

```
--- FAIL: TestGroup (0.14s)
    changelog_test.go:843: 
        	Error Trace:	/home/runner/work/goreleaser/goreleaser/internal/pipe/changelog/changelog_test.go:843
        	Error:      	Expect "## Changelog
        	            	### Features
        	            	* ec216fc3537667e300da4181c6b51520367afd28 feat: added that thing
        	            	### Bug Fixes
        	            	* 5132e678d5f69a366415474cefce012c640a7de9 bug: Merge pull request #999 from goreleaser/some-branch
        	            	### Bots
        	            	* dd9571e27c5a4f19882b8062a790636376b677bc feat(deps): update foobar [bot]
        	            	### Others
        	            	* c9b95e3b52ad6a82bacabae63decd45b1038d137 this is not a Merge pull request
        	            	* 260f70d5c2b6e31a35058b727818a78a7d589a22 chore: something about cArs we dont need
        	            	* 0969cba5b1363473e05eb251ffefbccd46fa6fc8 first
        	            	* c504cb0173a1f312ab39d17852f86b95504ff767 docs: whatever
        	            	* d57cab9360470d0e0a03d1ecb4763e89fe182f8f fix: whatever
        	            	* 2e659ceef3f2231ed107c80954833d9073091dd3 ignored: whatever
        	            	* 72658b11fd2789a03e83496d723a9196f7b14467 fixed bug 2
        	            	* 883d4fab813e6849520463b5325077a9ef45131d added feature 1
        	            	" to match "## Changelog
        	            	### Features
        	            	\* \w+ feat: added that thing
        	            	### Bug Fixes
        	            	\* \w+ bug: Merge pull request #999 from goreleaser\/some-branch
        	            	### Bots
        	            	\* \w+ feat\(deps\): update foobar \[bot\]
        	            	### Others
        	            	\* \w+ first
        	            	\* \w+ this is not a Merge pull request
        	            	\* \w+ chore: something about cArs we dont need
        	            	\* \w+ docs: whatever
        	            	\* \w+ fix: whatever
        	            	\* \w+ ignored: whatever
        	            	\* \w+ fixed bug 2
        	            	\* \w+ added feature 1
        	            	"
        	Test:       	TestGroup
```


As we can see from the log, the first commit with the `first` message
can appear in a random order in the changelog.

---

## Solution

In the `TestGroup` unit test, we are making 11 git commits, all within a
second. There seems to be a bug with `git log` where it is unable to
order the commits in reverse chronological order if all commits have the
same authored and committed date, as shown below.

> [!note]
> `/tmp/TestGroup4125952855/001` is the temporary directory created by
`testlib.Mktmp` in `TestGroup` test.

`git log` without revision range:

```
/tmp/TestGroup4125952855/001 main ❯ git log --oneline
85f005f (HEAD -> main, tag: v0.0.2) this is not a Merge pull request
27dbd0e bug: Merge pull request #999 from goreleaser/some-branch
3495034 feat: added that thing
9f0db77 chore: something about cArs we dont need
634e043 docs: whatever
ef52fef fix: whatever
ff49bea feat(deps): update foobar [bot]
e0f4e4b ignored: whatever
ce7fbfa fixed bug 2
940a684 added feature 1
2750980 (tag: v0.0.1) first
```

`git log` with multiple revision ranges, the "first" commit appears at
the top:

```
/tmp/TestGroup4125952855/001 main ❯ git log --oneline 2750980 v0.0.2
2750980 (tag: v0.0.1) first
85f005f (HEAD -> main, tag: v0.0.2) this is not a Merge pull request
27dbd0e bug: Merge pull request #999 from goreleaser/some-branch
3495034 feat: added that thing
9f0db77 chore: something about cArs we dont need
634e043 docs: whatever
ef52fef fix: whatever
ff49bea feat(deps): update foobar [bot]
e0f4e4b ignored: whatever
ce7fbfa fixed bug 2
940a684 added feature 1
```

If we specify only one revision, then the commits are ordered correctly
in reverse chronological order:

```
/tmp/TestGroup4125952855/001 main ❯ git log --oneline v0.0.2
85f005f (HEAD -> main, tag: v0.0.2) this is not a Merge pull request
27dbd0e bug: Merge pull request #999 from goreleaser/some-branch
3495034 feat: added that thing
9f0db77 chore: something about cArs we dont need
634e043 docs: whatever
ef52fef fix: whatever
ff49bea feat(deps): update foobar [bot]
e0f4e4b ignored: whatever
ce7fbfa fixed bug 2
940a684 added feature 1
2750980 (tag: v0.0.1) first
```

Based on my observations, this bug can only happen when all commits are
created at the same time, and the user is creating their first release
note.

This commit fixes the bug by excluding the first commit SHA-1 hash from
`git log` in `gitChangeLogger`.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-10-07 21:45:32 -03:00
Eng Zer Jun
b8aef100f2
perf(changelog): improve changelog sort performance (#5161)
This commit removes the unnecessary slice copy in `sortEntries`, and
replaces `sort.Slice` [^1] with the new `slices.SortFunc` [^2].

As recommended by the Go documentation, `slices.SortFunc` is generally
faster because it uses generic, whereas `sort.Slice` relies on
reflection, which incurs additional allocations

The benchmark result from the newly added `Benchmark_sortEntries` show
approximately a 64% performance improvement.


Benchmark result:

```
                     │   old.txt    │               new.txt               │
                     │    sec/op    │   sec/op     vs base                │
_sortEntries/asc-16    16.458µ ± 1%   5.958µ ± 1%  -63.80% (p=0.000 n=10)
_sortEntries/desc-16   17.675µ ± 1%   6.020µ ± 0%  -65.94% (p=0.000 n=10)
geomean                 17.06µ        5.989µ       -64.89%

                     │   old.txt    │               new.txt                │
                     │     B/op     │     B/op      vs base                │
_sortEntries/asc-16    3.164Ki ± 0%   1.164Ki ± 0%  -63.21% (p=0.000 n=10)
_sortEntries/desc-16   3.422Ki ± 0%   1.164Ki ± 0%  -65.98% (p=0.000 n=10)
geomean                3.290Ki        1.164Ki       -64.62%

                     │  old.txt   │              new.txt               │
                     │ allocs/op  │ allocs/op   vs base                │
_sortEntries/asc-16    68.00 ± 0%   25.00 ± 0%  -63.24% (p=0.000 n=10)
_sortEntries/desc-16   72.00 ± 0%   25.00 ± 0%  -65.28% (p=0.000 n=10)
geomean                69.97        25.00       -64.27%
```

[^1]: https://pkg.go.dev/sort#Slice
[^2]: https://pkg.go.dev/slices#SortFunc

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-09-30 13:27:29 -03:00
Carlos Alexandro Becker
0468da12fd
feat: default GOARM change to 7 (#5157)
Guarded by an environment variable for now.

Closes #5155
2024-09-27 13:31:29 -03:00
Carlos Alexandro Becker
ae301b3773
test: update golden files
refs 33dfbce4823a9f80854b7f063541d155260a79e0

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-27 10:33:17 -03:00