1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-16 03:52:12 +02:00
Commit Graph

1667 Commits

Author SHA1 Message Date
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
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
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
Manuel Rüger
6272ce0e6d
fix: Handle error on failed release (github) (#5106)
When trying to release an artifact to github and it fails, I observed
the following stacktrace:
```
• publishing
    • scm releases
      • releasing                                    tag=v1.11.0 repo=my-github-repo
      • could not check rate limits, hoping for the best...
      • could not check rate limits, hoping for the best...
      • took: 1m40s
  • took: 1m40s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe28b72]
goroutine 55 [running]:
github.com/goreleaser/goreleaser/v2/internal/client.(*githubClient).createOrUpdateRelease(0xc0001b24c8, 0xc0002c5108, 0xc000b478, {0xc00039ed00, 0x80e})
	github.com/goreleaser/goreleaser/v2@v2.2.0/internal/client/github.go:454 +0x3b2
github.com/goreleaser/goreleaser/v2/internal/client.(*githubClient).CreateRelease(0xc0001b24c8, 0xc0002c5108, {0xc00039ed00, 0x80e})
	github.com/goreleaser/goreleaser/v2@v2.2.0/internal/client/github.go:402 +0x339
github.com/goreleaser/goreleaser/v2/internal/pipe/release.doPublish(0xc0002c5108, {0x2ce2d40, 0xc0001b24c8})
...
```

I believe this happens because if the
[CreateRelease](c96ef954c3/github/repos_releases.go (L221))
fails, resp might be empty and the resp.Header does not exist, which
causes a segfault.
```
WithField("request-id", resp.Header.Get("X-GitHub-Request-Id")).
```

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2024-08-29 00:32:27 +00:00
Carlos Alexandro Becker
5a10792f7e
chore(deps): update go-github
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-08-28 11:29:50 -03:00
Nicolás Parada
a9e0a8f112
fix(build): ignore empty flags after templating (#5103)
Ignore empty flags after templating is applied for final Go build line.

This caused us some problems since we had an `if` without `else`,
resulting in an empty flag, causing the whole build to fail with a
misleading error message like:

```
malformed import path "-myflag": leading dash
```
2024-08-27 09:06:27 -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
3ae3a098e7
fix: isEnvSet and envOrDefault not working sometimes
closes #5059
2024-08-08 10:50:37 -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
Adam Bouqdib
893562ca73
fix(gitlab): release file URL broken (#5035)
<!--

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

Fix the GitLab upload URL.

<!-- Why is this change being made? -->
Gitlab changed upload URLs from 
`https://gitlab.com/{user}/{repo}/uploads/{hash}/file.ext` to
`https://gitlab.com/-/project/{projectID}/uploads/{hash}/file.ext`.

To avoid future issues like this the PR
https://github.com/xanzy/go-gitlab/pull/1968 was created upstream which
adds the `full_path` field to `go-gitlab` which this PR uses.

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

Fixes https://github.com/goreleaser/goreleaser/issues/4974
2024-08-03 13:56:42 -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
aa57879f75
chore(deps): update go-github to v63 2024-07-11 00:34:41 -03:00
Carlos Alexandro Becker
9d513696c2
fix: make latest on drafts (#4966)
this seems to fix the #4961
2024-06-29 19:42:20 -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
afd92ffe0f
fix(github): set discussion category on publish only
It has no effect if the release is a draft, and seems to be ignored
later when published.

Move setting the discussion category to the publish method only.

Closes https://github.com/orgs/goreleaser/discussions/4902
2024-06-15 15:48:05 -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
50a6a96257
fix(gitlab): better handle CI_JOB_TOKEN and unavailable APIs (#4918)
refs #4900
2024-06-15 13:47:12 -03:00
Carlos Alexandro Becker
34ba5b6a79
feat(build): use GOCACHEPROG if set (#4941)
refs #4939

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-15 13:45:54 -03:00
Carlos Alexandro Becker
675629e798
feat: support extra_files in http upload and artifactories (#4940)
closes #4937

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-15 12:21:29 -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
Carlos Alexandro Becker
d84738094d
fix: init in v2 (#4915)
closes #4914
2024-06-05 16:28:17 -03:00
actions-user
c891845839 chore: auto-update generated files 2024-06-05 00:46:45 +00: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
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
22f734e41f
Merge pull request from GHSA-f6mm-5fc7-3g3c
fixes GHSA-f6mm-5fc7-3g3c

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-15 10:18:29 -03:00
Carlos Alexandro Becker
9cf3bbbc5c
fix(build): do not print 'go: downloading' bits of go build output (#4869)
this prevents printing `go: downloading` on go builds in case the mods
weren't previously downloaded...
2024-05-15 10:13:10 -03:00
Carlos Alexandro Becker
d4e83b0766
chore: fmt 2024-05-14 22:41:49 -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
Oleksandr Redko
c148106c56
docs: update old Go website links (#4855)
The PR updates the links in the docs, replacing the old `golang.org`
with the new `go.dev`.
2024-05-12 13:22:56 -03:00
Oleksandr Redko
00a376cc64
refactor: remove unneeded in Go 1.22 loop var copy (#4856)
The PR cleans up unnecessary loop variable copying and enables the
[`copyloopvar`](https://golangci-lint.run/usage/linters/#copyloopvar)
linter for detecting this redundant variable copying.

#### Additional notes

After the project upgraded to Go version 1.22 in #4779, copying
variables inside a `for` loop became unnecessary. See this [blog
post](https://go.dev/blog/loopvar-preview) for a detailed explanation.

The `copyloopvar` linter is only available from `golangci-lint` v1.57
onwards, so we also need to update this tool.
2024-05-12 13:21:13 -03:00
Oleksandr Redko
c5204dfb64
fix: close HTTP resp body to prevent resource leak (#4857)
This PR fixes possible resource leaks by adding a statement that closes
a response body.

From the [documentation](https://pkg.go.dev/net/http):
> The caller must close the response body when finished with it

Also, see this
[article](https://golang50shad.es/index.html#close_http_resp_body) for a
deep dive into the problem.
2024-05-12 13:17:31 -03:00
Carlos Alexandro Becker
ba7e915cd8
docs: announce v1.26 (#4851)
planning the releaser for saturday!

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-11 14:21:51 -03:00
Carlos Alexandro Becker
0481e63fb3
docs: remove mentions to --skip-something flags 2024-05-09 23:18:53 -03:00
Carlos Alexandro Becker
12e8c22e12
test: blob defaults when no content disposition
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-09 22:15:23 -03:00
Maxime VISONNEAU
3c0c7148fd
blob: permit skipping the configuration of the Content-Disposition header (#4832)
This change would allow users to disable the `Content-Disposition`
header that is set for blob storage operations. The application will
continue to set a default value for `Content-Disposition` of
`attachment; filename={{.Filename}}` if no value was provided by the
user. However, with this change, users can now specifically disable this
header by setting the value to "-" in the configuration.

We feel this would be a nice solution for this issue:
https://github.com/Homebrew/brew/issues/15604
2024-05-09 22:13:46 -03:00
Shun Sakai
5d98c69f0f
feat(checksum): supports BLAKE2 and SHA-3 (#4850)
If applied, these commits will allow users to use BLAKE2 (BLAKE2b-512
and BLAKE2s-256) and SHA-3 (SHA3-{224,256,384,512}) as checksum
algorithms.

This is because I think it would be useful if these algorithms could be
used as an alternative to SHA-1 and SHA-2. These algorithms are
standardized as [RFC
7693](https://datatracker.ietf.org/doc/html/rfc7693) (BLAKE2) and [FIPS
PUB
202](https://www.nist.gov/publications/sha-3-standard-permutation-based-hash-and-extendable-output-functions)
(SHA-3).

- <https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE2>
- <https://en.wikipedia.org/wiki/SHA-3>
2024-05-09 21:45:28 -03:00
Carlos Alexandro Becker
21f8ab78d5
chore: warnf -> warn 2024-05-08 15:34:46 -03:00
Carlos Alexandro Becker
172d6d4b99
Revert "fix: temp disable snapcraft" (#4830)
Reverts goreleaser/goreleaser#4826

for when there's a new snap release!
2024-05-06 00:20:39 -03:00
Carlos Alexandro Becker
14ab459300
fix(brew): linux brew with extra end
refs #4822

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-05 23:04:22 -03:00
Carlos Alexandro Becker
fbddb7081d
fix: temp disable snapcraft (#4826)
refs #4816

temp disable it from our release, and disable the broken tests
2024-05-03 09:21:52 -03:00
Carlos Alexandro Becker
d9adeb3585
test(brew): update goldenfiles
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-02 20:43:23 -03:00
kvendingoldo
b05a62fddc
feat: migrate to new homebrew constuctions (on_arm, on_intel) (#4822)
<!--

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? -->
Brew linter says that old constructions can't be used in case of
submitting to brew-core

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

...
2024-05-02 20:43:03 -03:00
Carlos Alexandro Becker
2f876631b3
fix(nix): update valid licenses
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-02 20:39:26 -03:00
Stepan Rabotkin
7982a33a06
fix: telegram default message (#4821)
Hi, there is another fix of default message. I tried this message, now
everything works
2024-05-02 20:37:15 -03:00
Carlos Alexandro Becker
bee8665d9e
fix(brew): cpu conditionals (#4814)
closes #4813

---------

Co-authored-by: William Walker <w_walker@icloud.com>
2024-04-28 20:36:28 -03:00
Carlos Alexandro Becker
bf31227b4e
fix(nfpm): termux platform (#4812)
closes #4810 
closes  #4809

---------

Co-authored-by: rsteube <rsteube@users.noreply.github.com>
2024-04-28 20:20:53 -03:00
Carlos Alexandro Becker
0f5bf60239
chore: delete unused test file
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-24 16:16:52 -03:00
Carlos Alexandro Becker
39bf6668bc
feat(changelog): custom commit format (#4802)
This allows to use templates for commit messages in the changelog when
using `github`, `gitea`, or `gitlab` as the changelog implementation.

closes #4800

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-24 09:08:20 -03:00
Matthias Baur
2c93bd7c7f
feat(gitlab): Allow PRs to be created (#4793)
**Depends on #4792**

This adds support for opening pull requests on brew, krew, nix, scoop
and winget changes with Gitlab.

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-23 22:49:18 -03:00
Carlos Alexandro Becker
ddb60f417e
refactor: improve switch 2024-04-23 09:11:49 -03:00
Carlos Alexandro Becker
bfb2217f02
test: fix gitea changeloger tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-23 09:08:54 -03:00
Carlos Alexandro Becker
673555519a
refactor: improve switch
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-23 09:08:46 -03:00
Matthias Baur
fd40f5d772
fix(gitlab): Use start_branch for file creation if branch doesn't exist already (#4792)
Creating files on a new branch is only possible with the API if
`start_branch`
is given otherwise the API returns:

> You can only create or edit files when you are on a branch

Fixes https://github.com/goreleaser/goreleaser/issues/4543

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-23 09:01:23 -03:00
Carlos Alexandro Becker
7552d0b4e0
fix: lint issues
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:44:28 -03:00
Carlos Alexandro Becker
2dcfc98a09
test: update gitea tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:40:04 -03:00
Carlos Alexandro Becker
b1723afff2
fix(gitea): changelog output
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:39:52 -03:00
Bo-Yi Wu
c8488dc825
feat(gitea): implement Changelog function (#4794)
- Add `strings` package import to `gitea.go`
- Implement `Changelog` function in `gitea.go`
- Update `useGitea` constant in `changelog.go`
- Add test for `useGitea` in `changelog_test.go`
- Update `changelog.md` with information about `gitea` customization

ref:

* Server API: https://github.com/go-gitea/gitea/pull/30349
* SDK: https://gitea.com/gitea/go-sdk/pulls/659

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:26:13 -03:00
Carlos Alexandro Becker
b45c3b1720
fix(bluesky): change default env, fix user agent, update tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:25:00 -03:00
Josh Ghiloni
de72cab5d9
feat(announce): add BlueSky support (#4779)
<!--

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

If applied, this commit will allow users to create BlueSky posts
(skeets) about their Goreleaser-built projects

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

Because I wanted to post to BlueSky when projects I work on relating to
BlueSky are built!

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

Example post made during unit testing (requires an account to see):
https://bsky.app/profile/jaygles.bsky.social/post/3kpv573c2pc2k

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-22 23:15:26 -03:00
Carlos Alexandro Becker
3cd2e07c68
feat: notarize macos binaries (#4774)
this includes anchore/quill as a pipe to sign and notarize macos
binaries

TODO:

- [x] find a way to test this
- [x] docs
- [x] maybe get someone from anchore to take a look?

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-19 22:27:50 -03:00
Carlos Alexandro Becker
262c8dcbfe
chore(deps): update env from v9 to v11 (#4789)
updated env to latest

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-16 22:51:47 -03:00
Carlos Alexandro Becker
1ed1a62b90
fix: winget paths on windows (#4786)
closes  #4785
2024-04-16 20:57:22 -03:00
Carlos Alexandro Becker
5d37c9a5a0
feat: always log build output (#4787)
if the output is not empty, log it with info.

this prevents potentially hiding warnings et al.

on successful builds usually the output is empty anyway.

closes #4782

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-04-16 20:57:01 -03:00
Stepan Rabotkin
d5fc94a81d
refactor: optimize strings replacers (#4788)
Reuse strings replace instead of recreation
2024-04-16 20:56:45 -03:00
Stepan Rabotkin
56e0f79473
fix(telegram): mdv2escape ProjectName by default (#4784)
This pull request fix case when ProjectName contains any not escaped
symbols
2024-04-15 07:57:45 -03:00
Carlos Alexandro Becker
60a1cccf57
feat: isEnvSet tmpl function (#4775)
useful for conditionally enable/disable things based on whether an env
var is set or not
2024-04-12 11:09:18 -03:00
Carlos Tadeu Panato Junior
780a3a40d9
fix: update SBOM generation to add .json as file type (#4781)
- add the file type in the end of the sbom generated file 
- fix wrong value attribution in the doc example

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
2024-04-12 11:04:55 -03:00
Carlos Alexandro Becker
dabe1f31bf
test(ko): make test more stable 2024-04-08 10:11:34 -03:00
lvyaoting
eba43c289e
chore: fix some comments (#4769)
fix some comments

Signed-off-by: lvyaoting <lvyaoting@outlook.com>
2024-04-08 10:08:09 -03:00