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.
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>
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>
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>
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
```
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>
building upon the great work done at #4898closes#4898
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Dylan Myers <dylan.myers@bluemedora.com>
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>
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>
<!--
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>
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>
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
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
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
<!--
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 "2006" }} 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
### Other
* cfa5cbfa5 test
</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!
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
<!--
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
-->
...
<!--
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>
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>
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.
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
<!--
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
-->
...
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>
**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>
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>
- 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>
<!--
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>
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>
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>
- 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>