1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +02:00
Commit Graph

1143 Commits

Author SHA1 Message Date
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. 71e7a63ca1

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. 747c11d833

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. 10980311a5

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 33dfbce482

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-27 10:33:17 -03:00
Leo Robinovitch
33dfbce482
fix: remove filetype exe from chocolatey template (#5159)
When submitting a new project to chocolatey using goreleaser, a reviewer
told me that a line in the template is incorrect:

<img width="1054" alt="image"
src="https://github.com/user-attachments/assets/423c4493-85fa-4cc5-8a74-97d2a561743b">

<img width="1052" alt="image"
src="https://github.com/user-attachments/assets/04425da1-eb90-4504-9308-9a2e49ca85d8">

> since that is not a valid parameter to the
Install-ChocolateyZipPackage function:
https://docs.chocolatey.org/en-us/create/functions/install-chocolateyzippackage/

This PR aims to correct that by removing the line from the template as
requested
2024-09-27 10:32:11 -03:00
James Telfer
2bdfbdcbfe
fix: signature template failed silently after signing process completed (#5148)
The presence of an artifact field in the `signature` or `certificate`
template field caused a silent failure in the template when re-applied
after the external signing process was called.

This was due to the artifact being presence in the template context
before the signing process, but not after. An error here was also
ignored.

The fix supplies the artifact to the template context, and also allows a
template failure to
fail the overall process.

As far as I can tell, this change aligns behaviour to match existing
documentation.

Fixes #5147
2024-09-23 09:14:26 -03:00
Carlos Alexandro Becker
d3f8bbf31a
fix: snapshot version template should not have the leading 'v'
closes #5142
2024-09-19 23:55:10 -03:00
Carlos Alexandro Becker
e8c2ef7735
fix: upx UnknownExecutableFormatException
closes #5141
2024-09-17 09:30:49 -03:00
actions-user
34974df0c6 chore: auto-update generated files 2024-09-12 19:43:42 +00:00
Julien Salleyron
40668d4382
fix(build): c-shared build and release when target is wasm (#5128)
This commit fixes the automatic extension when building the wasip1_wasm
target.

Additionally, in future Go versions, support will be added for
generating c-shared WASM binaries.
https://github.com/golang/go/issues/65199


Therefore, this PR corrects the extension in the build process and
removes the .h file from the release when c-shared is enabled and the
target is WASM.
2024-09-09 22:25:54 -03:00
Carlos Alexandro Becker
708cd8904d
feat(ko): snapshot builds (#5116)
this makes ko run on snapshot builds, too.

the image will be `goreleaser.ko.local:[your tags]`, not sure if we can
change this, seems like we can't.

also fixed a small doc error around it, as well as added a new test to
cover this.

closes #4683

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-07 11:15:48 -03:00
Carlos Alexandro Becker
301b193e6e
feat(build): templateable no_unique_dist_dir (#5115)
closes https://github.com/goreleaser/goreleaser/issues/5024

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-07 11:09:06 -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
05c79c9dfc
test: check if pre-requisites are installed (#5109)
closes #5104
2024-09-03 20:39:33 -03:00
Tom Payne
3a36a49984
chore: fix linter errors (#5111)
If applied, this commit will fix the current linter errors, which are
currently causing all Github Actions to fail.

See, for example, the latest `main` run:
https://github.com/goreleaser/goreleaser/actions/runs/10607661596/job/29400451251.
2024-08-30 17:03:10 -03:00
Carlos Alexandro Becker
599ce44c74
test: do not fail if missing binaries (#5107)
closes #5104

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-28 23:30:22 -03:00
Carlos Alexandro Becker
6445e43a78
test(ko): fix chainguard image label update
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-26 09:12:02 -03:00
Carlos Alexandro Becker
c95bcdc1c6
chore(deps): update gocloud to v0.39.0 (#5091)
forcing `awssdk=v1` for now.

will probably need to remove that soon, holding it now only because of
https://github.com/google/go-cloud/issues/3472

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-18 16:58:28 -03:00
Carlos Alexandro Becker
5b87a85ee0
feat(nfpm): better support aix (#5075)
building upon the great work done at #4898


closes #4898

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Dylan Myers <dylan.myers@bluemedora.com>
2024-08-18 16:58:12 -03:00
Carlos Alexandro Becker
11aa7cfceb
feat(build): template skip (#5089)
closes #5071
2024-08-18 16:57:59 -03:00
Carlos Alexandro Becker
4e699a4caf
build: fix port error with dockertest on blob_minio_test.go (#5090)
This happened locally, doesn't seem to happen in the CI though.

Probably related to the Docker version.
2024-08-18 16:57:28 -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
81c5a206a5
test: make test pass on go 1.23 (#5079)
not sure if this is the right solution though

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-15 09:38:36 -03:00
actions-user
e50b72b4a8 chore: auto-update generated files 2024-08-15 02:43:54 +00:00
Carlos Alexandro Becker
47ff67b252
feat(deps): update ko and gocloud.dev (#5063)
cyclonedx and go.version-m were removed from latest ko version

https://github.com/ko-build/ko/pull/1333

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-09 19:51:02 -03:00
Carlos Alexandro Becker
5e4893234d
test: fix ko tests
the chainguard static image (used in tests) now have a bunch of labels.

this adds them to the tests.
2024-08-08 10:31:38 -03:00
Carlos Alexandro Becker
b6f9c8b9ca
feat: when --clean, remove dist before checking git state (#5057)
closes #5023
closes #5046

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-08 10:14:29 -03:00
Carlos Alexandro Becker
a8916c080e
feat: binary signs (#5018)
this is different from the default signs, in the sense that this will
sign the binaries even if archive mode is not set to binary.

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

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-03 14:36:54 -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
c9398ee88c
fix: consistent logging of source archive path 2024-07-24 09:58:42 -04:00
Furkan Türkal
ce4f2ed431
fix(ko): rework error message for relative path for .go suffix (#5005)
<!--

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? -->

Even though `^\.?(\.\/[^\/]?.*)?$` was matching with `./cmd/main.go`, I
spent ~10m to figure this out why it was complaining. And noticed that,
we were returning the same error on different case, which is `HasSuffix`
check. Let's clarify the error message a bit for better UX.

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

...

Signed-off-by: Furkan <furkan.turkal@trendyol.com>
2024-07-17 10:59:39 -03:00
actions-user
c3ea906db8 chore: auto-update generated files 2024-07-14 23:38:33 +00:00
Carlos Alexandro Becker
212dbb39d4
fix: improve snapcraft configuration handling
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-13 14:09:46 -03:00
Carlos Alexandro Becker
2e9eefb5b9
fix(snapcraft): set confinement to strict by default 2024-07-12 10:04:25 -03:00
Carlos Alexandro Becker
33e0fc4fe2
test(nfpm): improve ipk test 2024-07-11 21:57:50 -03:00
Weston Schmidt
cc114fc8b9
feat(nfpm): add support for ipk package format (#4863)
Adds code to expose the ipk configuration values and registers the ipk
package format with nfpm.

Updates the documentation with how to use the new ipk specific
configuration parameters.

**This isn't ready to merge, but I have some questions**

1. I copied the `TestIPKSpecificConfig()`
([code](https://github.com/goreleaser/goreleaser/compare/main...schmidtw:goreleaser:main#diff-912a4af69daf4d89537b6bea43a1b7fe65683128ea1be66d6ec77046c76d064dR1358))
from the `TestAPKSpecificConfig()` and found it only is really testing
if specific scripts are there or not. Since IPK doesn't have any
additional scripts, just fields in one file do I need this test
function? Is there a better way to validate the output?
2. I have run into issues where the tests expect `goreleaser` to be the
org & repo - is there a way to override this in my fork without changing
the code?
3. Is the `ToNFPAlts()` and `ToNFP()` living in the config.go file ok?
There wasn't much code in that file, so I figured I'd ask if you'd
rather this code be elsewhere.

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-11 21:57:33 -03:00
Carlos Alexandro Becker
f0b4db184e
fix: snapcraft temporary directory + concurrency (#4963)
this bug comes and goes every couple of versions it seems.

this will change the snapcraft implementation to run the first item
without concurrency, so all needed shared directories can be created
without issues, and then grows the limit of the wait group so the other
ones can run in parallel.

I haven't tested this yet, but I think it'll work.

- [x] test
- [x] godoc

refs https://github.com/goreleaser/goreleaser/issues/1715 refs
https://bugs.launchpad.net/snapcraft/+bug/1889741
2024-06-29 19:00:52 -03:00
Carlos Alexandro Becker
0f37dbd9d7
test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-26 08:52:22 -03:00
Carlos Alexandro Becker
9fcfaf95cf
fix: revert unwanted change 2024-06-22 23:12:01 -03:00
Carlos Alexandro Becker
0d1e3c023f
fix: moving some logs to debug 2024-06-22 22:43:57 -03:00
Carlos Alexandro Becker
9b6af9efba
fix: actually respect changelog.abbrev (#4942)
Some changelogers were always returning the short sha instead of the
full one, so setting an abbrev had no effect.

This fixes these changelogers, which should now always return the full
sha.

Note that github usually still shortens the SHAs rendered in markdown,
so the changes might not even be visible in most cases.

closes #4829
2024-06-15 15:40:08 -03:00
Carlos Alexandro Becker
3e663003b1
feat(blob): allow to upload only extra_files (#4925)
Not happy with the option name tbh... happy to hear suggestions :) 

refs #4921
refs https://github.com/goreleaser/goreleaser/issues/4920

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-12 09:03:36 -03:00
bradenhilton
ac40ce8a80
feat(chocolatey): allow template in copyright, provide ctx.ReleaseNotes (#4858)
<!--

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... -->

This PR allows `chocolateys.copyright` to be templated, and provides
`ctx.ReleaseNotes` as `.Changelog`.

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

Allowing templates for the copyright will enable, for example:

```yaml
chocolateys:
- ...
  copyright: Copyright (c) 1970-{{ .Now.Format "2006" }} Foo Bar
  ...
```

Without this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <copyright>Copyright (c) 1970-{{ .Now.Format &#34;2006&#34; }} Foo Bar</copyright>
    ...
  </metadata>
  ...
</package>
```

With this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <copyright>Copyright (c) 1970-2024 Foo Bar</copyright>
    ...
  </metadata>
  ...
</package>
```

---

Providing the release notes means they can be placed directly in the
package page instead of linking to them, for example:

```yaml
chocolateys:
- ...
  release_notes: '{{ .Changelog }}'
  ...
```

Without this change:

```console
❯ goreleaser release --skip=sign,announce,publish --clean
  • starting release...
  ...
  • chocolatey packages
    ⨯ release failed after 4s                  error=template: failed to apply "{{ .Changelog }}": template: failed to apply "{{ .Changelog }}": map has no entry for key "Changelog"
```

With this change:

```xml
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
  <metadata>
    ...
    <releaseNotes>## Changelog&#xA;### Other&#xA;* cfa5cbfa5 test&#xA;</releaseNotes>
    ...
  </metadata>
  ...
</package>
```

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

---

These are already supported for WinGet.

There is probably a better way of doing this, and I've probably also
missed something, so feedback is welcome!
2024-06-11 09:29:55 -03:00
Ralf Steube
cefec7c58b
feat(nfpm): support arm in termux (#4901)
This adds `arm` support for termux (arch needs to be called `arm` as
well).

---

Ok this drove me nuts, but I think I've got it working now:
https://github.com/carapace-sh/carapace-bin/releases/tag/v1.0.3

1.  First of all most of the `android` targets need `CGO_ENABLED=1`.

2. Then there's the need for a [patched
runtime](https://github.com/carapace-sh/go/tree/master/termux) due to
the `/data/data/com.termux/files` prefix (adopted from the [golang
package](https://github.com/termux/termux-packages/tree/master/packages/golang)).

3. Two builds so that for termux the patched `gobinary` can be used.
Then add a `termux` suffix to the archives for clarity.

```yaml
builds:
  - id: default
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - windows
      - darwin
    main: ./cmd/carapace
    binary: carapace
    tags:
      - release
  - id: termux
    env:
      - CGO_ENABLED=1
    goos:
      - android
    goarch:
      - amd64
      - arm64
      - arm
      - "386"
    main: ./cmd/carapace
    binary: carapace
    tags:
      - release
    gobinary: go-termux
archives:
  - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
    builds:
     - default
    format_overrides:
      - goos: windows
        format: zip
  - id: termux
    builds:
      - termux
    name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}.termux'
```

4. Compiling needs the [Android NDK](https://developer.android.com/ndk)
with the `CC` environment variable set. I used a
[script](https://github.com/carapace-sh/go/blob/master/go-termux.sh) for
this (`/usr/local/bin/go-termux`).

```sh
#!/bin/bash

bindir="/opt/android-sdk/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin"
[ "$GOARCH" = "amd64" ] && export CC="$bindir/x86_64-linux-android${ANDROID_VERSION}-clang"
[ "$GOARCH" = "arm64" ] && export CC="$bindir/aarch64-linux-android${ANDROID_VERSION}-clang"
[ "$GOARCH" = "arm" ] && export CC="$bindir/armv7a-linux-androideabi${ANDROID_VERSION}-clang"
[ "$GOARCH" = "386" ] && export CC="$bindir/i686-linux-android${ANDROID_VERSION}-clang"

exec /usr/local/go-termux/bin/go "$@"
```

5. There's [termux-apt-repo](https://github.com/termux/termux-apt-repo)
which makes repo creation pretty easy with `gh_pages`. Just needs a
[fix](https://github.com/termux/termux-apt-repo/pull/25) as goreleaser
uses `data.tar.gz`.

related #3333
related #4812 
related https://github.com/termux/termux-apt-repo/pull/25
2024-06-11 09:23:50 -03:00
Carlos Alexandro Becker
f3fce3df5b
feat: --skip=archive (#4916)
closes #4905
2024-06-11 09:23:21 -03:00
Carlos Alexandro Becker
2d54bf0211
feat(notary): allow to sign without notarizing (#4919)
closes #4890

- [x] docs
- [ ] tests
2024-06-11 09:20:48 -03:00
Carlos Alexandro Becker
618496b940
Revert "fix(blobs): do not upload artifacts if ids is set to empty (#4921)"
This reverts commit 5d7631f713.

This commit would actually be a breaking change, so let's revert it.
2024-06-09 20:01:16 -03:00
Brian Strauch
5d7631f713
fix(blobs): do not upload artifacts if ids is set to empty (#4921)
<!--

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... -->

Closes https://github.com/goreleaser/goreleaser/issues/4920

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

...

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

...
2024-06-09 19:56:06 -03:00