1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-04 03:11:55 +02:00
Commit Graph

1468 Commits

Author SHA1 Message Date
Aaron U'Ren
917cae54f0
fix(config): handle relative git repos (#4575)
## If applied, this commit will...

If applied this change will allow goreleaser to handle relative remotes
when attempting to parse a repo URL from git.

## Why is this change being made? 

To fix the error that I recently came across while trying to test my
goreleaser configuration:

```
% goreleaser check
  • checking                                 path=
  ⨯ configuration is invalid                 error=invalid scm url: .
  ⨯ .goreleaser.yml                                  error=configuration is invalid: invalid scm url: .
  ⨯ command failed                                   error=1 out of 1 configuration file(s) have issues
```

This change happened while on a branch doing some development. As part
of that development I needed to test a change to my goreleaser config.

My git config at the time looked like (repo obfuscated):

```
% cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = git@gitlab.com:some/repo
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[branch "release_fixes"]
        remote = .
        merge = refs/heads/main
```

It is fairly common for git to add remotes with a `.` when branch
tracking is enabled.

While, in general, there aren't many use cases that require a user to
need to release from a non-primary branch, there are cases where the
user may want to test their configuration with `goreleaser check` and
the error of `invalid scm url: .` isn't very helpful.

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-29 10:31:19 -03:00
Carlos Alexandro Becker
da30c39ccb
fix(nix): prevent importing makeWrapper when it's not needed
refs 7f95ff0a9a

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-27 09:12:55 -03:00
Carlos Alexandro Becker
7f95ff0a9a
fix(nix): improve generated derivations (#4582)
- use stdenvNoCC instead of pkgs.stdenvNoCC
- always include stdenvNoCC, even if no deps
- use stdenvNoCC.is(Darwin/Linux) instead of stdenv's

refs #4358
refs 003a8815

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-27 09:01:00 -03:00
Carlos Alexandro Becker
2ced7acdd9
fix(docker): remove --builder=default from default args when use=buildx (#4566)
refs #4392

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-22 20:27:40 -03:00
Carlos Alexandro Becker
bfa9e7fd17
refactor(winget): improve winget code
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-21 23:09:32 -03:00
Eng Zer Jun
1d44832f6b
refactor(http): remove redundant nil check (#4563)
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>
2024-01-21 21:51:03 -03:00
Carlos Alexandro Becker
6097ea50f5
fix: possible nil pointers on logs
refs https://github.com/goreleaser/goreleaser/pull/3966/files#r1460694856

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-21 21:46:59 -03:00
Carlos Alexandro Becker
ac398de727
fix(brew): improve handling of single os (#4562)
- 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>
2024-01-19 12:41:28 -03:00
Jamie Tanna
2a71473bf6
fix: Allow using double quotes for templates in Slack notifications (#4555)
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.
2024-01-19 10:57:16 -03:00
Carlos Alexandro Becker
1e0d269c97
fix(nix): sourceRoot when using archives.wrap_in_directory (#4550)
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>
2024-01-18 12:59:04 -03:00
Carlos Alexandro Becker
1ba3138c67
feat(tmpl): .GitTreeState and .IsGitClean
Avoids having too much template if blocks inside the configuration file.
2024-01-18 08:07:38 -03:00
Carlos Alexandro Becker
5d44ed14fd
feat(tmpl): contains
closes https://github.com/orgs/goreleaser/discussions/4548
2024-01-17 08:52:51 -03:00
Carlos Alexandro Becker
003a881503
fix(nix): use stdenvNoCC
closes #4538

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-15 08:55:21 -03:00
Carlos Alexandro Becker
29f30b623e
feat: deprecated changelog.skip in favor of changelog.disable
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-14 15:57:44 -03:00
Carlos Alexandro Becker
fe1bc52d6a
fix: build does not run chocolatey 2024-01-14 15:26:16 -03:00
Tom Payne
f724460ac1 feat: --skip=chocolately 2024-01-09 18:22:23 -03:00
Carlos Alexandro Becker
a342f027d7 feat(blob): content disposition
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
0f57398745 feat(blob): deprecate kmskey 2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
88ebab066d feat(blob): cache_control
Co-authored-by: Carlos Henrique Guardão Gandarez <gandarez@gmail.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
189aa15101 feat(blob): acl support for s3
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: warjiang <1096409085@qq.com>
2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
e800061e86 feat(blob): allow to customize whether to force path style
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: warjiang <1096409085@qq.com>
2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
50402270ab feat(blob): deprecate disableSSL
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-01-09 09:13:08 -03:00
Carlos Alexandro Becker
5e9f01e6ea
feat: --skip=nfpm 2024-01-07 23:16:24 -03:00
Carlos Alexandro Becker
e7f4b10fc6
fix: prevent having whitespaces in artifact names (#4515)
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>
2024-01-07 14:16:33 -03:00
Carlos Alexandro Becker
6e0fc795ee
fix: improve skip details (#4522)
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>
2024-01-07 14:12:50 -03:00
Carlos Alexandro Becker
2ab840b675
fix: remove disgo dependency (#4521)
closes #4520

it was easy enough to remove it :)
2024-01-05 09:34:56 -03:00
Carlos Alexandro Becker
dda1c708ae
feat(nix): validate licenses (#4497)
this will check if the license provided by the user is a valid one.

valid list of licenses is generated from nix's source code.

closes #4496
2023-12-26 08:37:44 -03:00
Carlos Alexandro Becker
8586878fdf
fix(aur): support wrap_in_directory (#4502)
closes #4500

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-12-26 08:37:28 -03:00
Carlos Alexandro Becker
27f0e3304b
feat(winget): support installing .exe directly (#4498)
closes #4494

---------

Co-authored-by: Vedant <83997633+vedantmgoyal2009@users.noreply.github.com>
2023-12-26 08:37:17 -03:00
Carlos Alexandro Becker
2b9e471370
fix(nix): include unzip if any artifact is a zip (#4495)
Instead of just the first one.

refs #4224
2023-12-21 14:21:20 -03:00
Carlos Alexandro Becker
ccd8c55b4f
test: run testifylint -fix (#4483)
fix a bunch of tests

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-12-17 15:34:28 -03:00
Carlos Alexandro Becker
711490dfc7
feat: aur dir (#4484)
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>
2023-12-17 14:52:09 -03:00
Carlos Alexandro Becker
ee14837127
feat(homebrew): add os to dependency (#4481)
closes #4480
2023-12-15 12:14:01 -03:00
Florent Lecoultre
159211ae78
fix: add -c flags when building go test (#4473)
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>
2023-12-12 17:41:02 -03:00
Carlos Alexandro Becker
aa9986e826
fix(github): do not fail branch creation if it already exists (#4471)
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>
2023-12-12 16:12:07 -03:00
Carlos Alexandro Becker
22fa9947c8
feat: allow to template builds.gobinary (#4454)
closes #4453

TODO: tests
2023-12-04 23:00:11 -03:00
Carlos Alexandro Becker
853275f379
feat(deps): update go-github to v57
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-12-04 07:45:55 -03:00
Carlos Alexandro Becker
142b94c533
fix: improve chocolatey no archive error handling and docs
closes #4450
2023-11-29 23:27:05 -03:00
Carlos Alexandro Becker
6f598dc9b0
refactor(brew): use cases.Title instead of strings.Title
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-11-29 23:12:46 -03:00
Carlos Alexandro Becker
a09a0d7018
fix(ko): error finishing with . 2023-11-29 23:12:07 -03:00
Carlos Alexandro Becker
d0d088dee7
test: fix 2023-11-29 22:40:10 -03:00
Carlos Alexandro Becker
1ec5245f51
test: improve brittle tests 2023-11-29 22:25:14 -03:00
Carlos Alexandro Becker
bd7933d185
feat: improve project and build hooks error handling
closes #4451
2023-11-29 22:01:13 -03:00
Carlos Alexandro Becker
25a054c5e1
feat: improve --single-target (#4442)
closes #4437 
closes #4426

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-11-27 18:29:50 -03:00
John Taylor
74e706461b
fix: allow homebrew to use tar.xz format (#4441)
<!-- 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.
2023-11-24 14:03:05 -03:00
Carlos Alexandro Becker
a5f767832a
SBOM improvements (#4430)
refs https://github.com/orgs/goreleaser/discussions/4425
2023-11-23 17:40:25 -03:00
Gabriel Cipriano
8f6b16f6b5
feat: validate ko's main path (#4429)
closes #4382
2023-11-19 14:54:18 -03:00
Gabriel Cipriano
59a3eeb56d
fix: linkedin announce api changes (#4428)
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>
2023-11-18 09:51:42 -03:00
Ernst Widerberg
d2d910f54f
docs: fix typos (#4406) 2023-11-06 09:14:07 -03:00
Carlos Alexandro Becker
b9cca21b7a chore: simplify test 2023-11-03 23:40:07 -03:00