From the Go specification [^1]:
> "3. If the map is nil, the number of iterations is 0."
Therefore, it is not required to do a nil check for the map before the
loop.
[^1]: https://go.dev/ref/spec#For_range
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
- refactors brew template into separated files using embed.FS
- moves the macos and linux packages to different template files
- includes and indent those accordingly to which OSes are supported
closes#4561
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
As noted in #4556, when we're using a double quote, for use with a
template variable or function, we receive a template parse error as the
value needs to be unquoted.
This provides a slightly hacky solution which is to unquote any quoted
quotes.
Closes#4556.
If `archives.[*].wrap_in_directory` is set, it'll create a folder inside
the archive file, usually something like `app_goos_goarch`.
In those cases, the root of the archive is not constant, so we create a
`sourceRootMap` and use it instead.
In cases where the `sourceRoot` is constant, the generated derivation
will be the same.
refs https://github.com/orgs/goreleaser/discussions/4549
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
refs #4513
this does not prevent the `dist` filepath to have spaces in it, although
that's likely less of an issue, but it will remove the spaces from
artifact's names.
Ideally, we could add a `tmpl.ApplyTrim` (or similar) that applies and
trim spaces, and use it everywhere it makes sense (which is likely a lot
of places).
Doing it on regular `Apply` might break things like release
footers/headers, which usually rely on empty lines (although maybe its
easier to treat those cases differently then).
Anyway, still thinking about it. Opinions are welcome :)
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
log all skip reasons instead of only one, using a multierror.Error to
merge them all.
refs https://github.com/orgs/goreleaser/discussions/4469
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
closes#4482
<!--
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>
when building a go test without the `-c` flag like so:
```yaml
builds:
- command: test
binary: env.test
dir: ./internal/builders/golang
no_main_check: true
```
will result in the error: `exit status 1: fork/exec : exec format error`
adding the -c flags when not present in the flags
adding unit test
https://github.com/goreleaser/goreleaser/issues/4462
---------
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
github api is eventually consistent... so, we might ask for the branch,
it might say it does't exist, and when we try and create it, it might
error because it already exists.
this should avoid breaking it
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
<!-- If applied, this commit will... -->
In a `brews` section, goreleaser will fail when using `format: tar.xz`
even though homebrew supports installing binaries bundled in a `.tar.xz`
archive.
<!-- Why is this change being made? -->
I use `.tar.xz` instead of `.tar.gz` and would like goreleaser to
support this when used in conjunction with `brews` sections.
With this patch, I created a test [homebrew
formulae](https://github.com/jftuga/homebrew-tap/blob/main/awswho.rb)
and successfully installed it under macOS.
Closes#4421
I chose to keep `getProfileID` as `getProfileIDLegacy` and use it as a
fallback if `getProfileSub` fails because of permission scope.
In this way, it's not a breaking change because one that has only a
deprecated permissions such as `r_liteprofile` will still be able to hit
`v2/me`
this logic is encapsulated in the new function `getProfileURN`, that
resolves the user identifier and returns it formatted as a URN
---------
Co-authored-by: Gabriel F Cipriano <gabriel.cipriano@farme.com.br>