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

1510 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
954121ffb1 feat: --skip-nix 2023-11-03 21:47:09 -03:00
Carlos Alexandro Becker
53071b6642 feat: --skip=aur 2023-11-03 21:47:09 -03:00
Carlos Alexandro Becker
2223c93b8c
feat: check if go.mod has replace directives (#4398)
closes #4395
2023-11-03 21:42:09 -03:00
Carlos Alexandro Becker
1a8702f140
feat: --skip=snapcraft 2023-11-03 23:24:04 +00:00
Carlos Alexandro Becker
c6cb980c4f
feat: --skip=winget 2023-11-03 23:23:25 +00:00
Carlos Alexandro Becker
8ce439972a
feat: --skip=scoop 2023-11-03 23:22:50 +00:00
Carlos Alexandro Becker
b8cc16d4ac
fix: .Amd64 in build hooks
closes #4399
2023-11-02 12:47:00 +00:00
Carlos Alexandro Becker
3a3cf610f8
docs: conventional file name on armv6
refs https://github.com/charmbracelet/meta/pull/116
2023-11-02 12:32:31 +00:00
Carlos Alexandro Becker
896366f3dc feat: version in the yaml file
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-10-31 15:10:16 -03:00
Carlos Alexandro Becker
d4540f884f
test: fix unstable test 2023-10-30 15:50:30 +00:00
Gabriel F Cipriano
cf008d3ed7 fix: sort checksum lines by filename 2023-10-30 12:49:39 -03:00
Raito Bezarius
1a5d3ffa02 feat(nix): mark all Nix packages with the right source provenance
As GoReleaser focuses on binary packages wrapped in Nix, it is important
to mark their right source provenance, i.e. binary native code.
2023-10-30 12:23:14 -03:00
Carlos Alexandro Becker
7d21a1b553
test: update assertion 2023-10-17 17:50:57 +00:00
Carlos Alexandro Becker
91c8db3973
fix: github getbranch maxredirects 2023-10-17 15:52:41 +00:00
Carlos Alexandro Becker
1a243dfc0d
feat(deps): update go-github to v56
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-10-14 22:04:41 +00:00
Carlos Alexandro Becker
3cfefcc4ce
fix: decouple project_name guessing from the release pipe (#4335)
the release's defaults run before the project's does, so, usually the
github/gitlab/gitea names are set.

however, in some cases, the release's defaults might be skipped, in
which case they'll be empty.

this breaks things like `goreleaser changelog`, especially on non-go
repositories.

this pr tries to extract the project name from the git remote url in the
project's defaulter.

it might be possible now to move it to run before the release defaulter,
even.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-10-14 18:59:07 -03:00
Carlos Alexandro Becker
6b00bb9664
refactor: use ordered.First (#4362) 2023-10-10 23:16:27 -03:00
Eng Zer Jun
37e3fdee55
refactor(tmpl): avoid unnecessary byte/string conversion (#4356)
We can use `(*regexp.Regexp).MatchString` instead of
`(*regexp.Regexp).Match([]byte(...))` to avoid unnecessary `[]byte`
conversions and reduce allocations. A one-line change for free
performance gain.

Benchmark:

```go
func BenchmarkMatch(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := envOnlyRe.Match([]byte("{{ .Env.FOO }}")); !match {
			b.Fail()
		}
	}
}

func BenchmarkMatchString(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := envOnlyRe.MatchString("{{ .Env.FOO }}"); !match {
			b.Fail()
		}
	}
}
```

Result:

```
goos: linux
goarch: amd64
pkg: github.com/goreleaser/goreleaser/internal/tmpl cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16          	 4320873	       381.2 ns/op	      16 B/op	       1 allocs/op
BenchmarkMatchString-16    	 5973543	       203.9 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/goreleaser/goreleaser/internal/tmpl	3.366s
```

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-10 09:54:44 -03:00
Carlos Alexandro Becker
7efeeb37c1
refactor: improve ssh key gen on tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-10-06 14:16:58 +00:00
Carlos Alexandro Becker
f3d2864db3
refactor: improve releases/scm.go a bit (#4334)
use `ApplyAll`

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-29 13:37:43 -03:00
Carlos Alexandro Becker
aba74099bc
style: invert if statement 2023-09-27 02:11:39 +00:00
Carlos Alexandro Becker
26fed97a0d
fix(git): error when pushing to a git repo with no branch
refs https://github.com/orgs/goreleaser/discussions/4321#discussioncomment-7108865
2023-09-26 11:20:15 +00:00
Carlos Alexandro Becker
82200491bd
fix: git client should respect specified branch (#4324)
refs https://github.com/orgs/goreleaser/discussions/4321
2023-09-24 17:07:10 -03:00
Carlos Alexandro Becker
530223c2ac
chore: improvel logs
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-24 19:18:10 +00:00
Carlos Alexandro Becker
41ce3c0304
fix: git.ignore_tags not working (#4322)
also regex is not possible there currenctly, didnt realized it at the
time

refs #4255

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-23 02:37:48 -03:00
Carlos Alexandro Becker
d5a81df6c5
docs: improve tmpl.map
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-20 19:21:30 +00:00
Jo
24347358e9
feat: add map and indexOrDefault template functions (#4317)
Add a new function `map` to template functions.

`map` creates a map from a list of pairs of key values, then you can
convert a key to a value using `.Get`. This simplifies writing
key-mapping templates. For example, the defaule `archives.name_template`

```yaml
name_template: >-
    {{ .ProjectName }}_
    {{- title .Os }}_
    {{- if eq .Arch "amd64" }}x86_64
    {{- else if eq .Arch "386" }}i386
    {{- else }}{{ .Arch }}{{ end }}
    {{- if .Arm }}v{{ .Arm }}{{ end }}
```

becomes

```yaml
name_template: >-
  {{ $arch := map "amd64" "x86_64" "386" "i386" -}}
  {{ .ProjectName }}_
  {{- title .OS }}_
  {{- $arch.Get .Arch .Arch }}
  {{- if .Arm }}v{{ .Arm }}{{ end }}
```

---------

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-20 16:03:46 -03:00
Carlos Alexandro Becker
bedf38cae6
fix(skips): print all steps that will be skipped (#4319)
this will log everything that's being skipped in the beginning of the
release process.

also added some tests to `skips`

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-20 13:15:32 -03:00
Carlos Alexandro Becker
08d63aa5ff
fix(skips): print all steps that will be skipped 2023-09-20 15:03:46 +00:00
Carlos Alexandro Becker
7e638371fd
chore(winget): add comment
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-20 15:03:45 +00:00
Carlos Alexandro Becker
a84f8246c2
test: fix nfpm test after update 2023-09-20 14:15:08 +00:00
Carlos Alexandro Becker
5df77d20a0
test: fix broken tests 2023-09-17 18:11:20 +00:00
Carlos Alexandro Becker
cd2feb3c81
fix(sbom): syft might fail on windows (#4301)
the paths of the artifacts always use forward slashes, and the logic to
handle the relative path stuff inside the sbom pipe did not account for
that.

running the paths through `filepath.Clean` beforehand fixes it.

also improved yamlschema a little bit :) 

closes #4289
2023-09-17 14:23:04 -03:00
Carlos Alexandro Becker
8ef8babedf
feat(winget): support dependencies (#4299)
closes #4296
2023-09-17 14:22:39 -03:00
Carlos Alexandro Becker
0fe02a136a
fix(git): ignore_tags should ignore empty 2023-09-17 17:03:02 +00:00
Carlos Alexandro Becker
16d84c5973
feat: skip pre build hooks 2023-09-17 16:59:34 +00:00
Carlos Alexandro Becker
d90c2ca2f2
fix: skip post-hook on universal binaries as well
closes #4278
2023-09-17 16:56:26 +00:00
Carlos Alexandro Becker
0337a0b3a8
refactor: improve --skip completions
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-17 03:00:15 +00:00
Carlos Alexandro Becker
622c426eb3
refactor: --skip=item (#4272)
Laying the ground work to allow skipping more pipes without adding new
flags et al.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-16 17:01:20 -03:00
Carlos Alexandro Becker
85c86d61cf
fix: chocolatey push failing (#4300)
tested this on a fake repo, and it seems to fix the problem...

seems like choco does not like when the path has `/` in it, so passing
it through `filepath.Clean` fixes it.

also improved tests a bit, and made a small docs fix.


closes https://github.com/goreleaser/goreleaser/issues/4292
2023-09-16 14:08:11 -03:00
Vedant
cd139a78b5
feat(winget): update manifest schema version & links (#4298)
Use the latest schema `1.5.0` available on winget-pkgs.
2023-09-16 11:01:04 -03:00
Carlos Alexandro Becker
dbec7054ea
test: fix 2023-09-13 17:02:51 +00:00
Duane Waddle
01a93b4329
fix(sbom): Add LOCALAPPDATA to passthroughEnvVars (#4291)
Adds windows-specific `LOCALAPPDATA` to the list of passed through
environment variables.

closes #4290
2023-09-13 13:50:14 -03:00
Carlos Alexandro Becker
4240a0fdb9
feat(deps): udpate go-github to v55
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-11 13:53:33 +00:00
Carlos Alexandro Becker
91fe5e40c4
fix: improve git info log output
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-07 18:48:48 +00:00
Carlos Alexandro Becker
67039edc35
fix: typo in error message 2023-09-07 18:48:48 +00:00
Carlos Alexandro Becker
5c8b5ced67
test: gomod on old go version
refs #4280

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-07 18:08:56 +00:00
Marcin Białoń
bb175015c7
feat: skip gomod pipe when Go does not support modules (#4280)
<!--

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

The gomod pipe will skip if the Go version does not support modules.

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

I tried to use goreleaser to build a project with Go v1.8.7 and it
failed on `loading go mod information` step. The Go version used doesn't
support `go list -m`.

The build failed with the following error:
```
  • loading go mod information
  ⨯ release failed after 0s                          error=failed to get module path: exit status 2: flag provided but not defined: -m
usage: list [-e] [-f format] [-json] [build flags] [packages]

List lists the packages named by the import paths, one per line.
...
```

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

...
2023-09-07 15:01:57 -03:00
Carlos Alexandro Becker
962429de06
fix(custom_publishers): skip publish is check by publish pipe (#4274)
the publish pipe, which runs all publishers, already skips all
publishers if skip publish is set, so this check is not needed here.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-04 16:21:11 -03:00
Carlos Alexandro Becker
da1d3f4fcf
fix(chocolatey): skip publish is check by publish pipe (#4273)
the publish pipe, which runs all publishers, already skips all
publishers if skip publish is set, so this check is not needed here.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-04 16:20:58 -03:00
Carlos Alexandro Becker
a962e3b3cf
fix(snapcrafts): skip publish is check by publish pipe (#4275)
the publish pipe, which runs all publishers, already skips all
publishers if skip publish is set, so this check is not needed here.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-04 16:20:36 -03:00
Carlos Alexandro Becker
8706fd2e89
feat: allow goreleaser to run in gerrit, soft-serve and others (#4271)
Currently, GoReleaser will assume you're running against github, gitea
or gitlab.

You could set `release.disable: true`, but it would still set and try to
use some defaults that could break things up.

Now, if you disable the release, goreleaser will not set these defaults.
It'll also hard error in some cases in which it would happily produce
invalid resources before, namely, if `release.disable` is set, and, for
example, `brews.url_template` is empty (in which case it would try to
use the one from the release, usually github).

closes #4208
2023-09-04 11:23:38 -03:00
Carlos Alexandro Becker
a14404f0f3
feat: support WASI (#4230)
`wasip1` is a valid `GOOS` value in the upcoming go 1.21.
2023-09-02 14:43:07 -03:00
Carlos Alexandro Becker
62cc45aa50
feat: templates in upx.enabled (#4269)
refs https://github.com/orgs/goreleaser/discussions/4268
2023-09-01 15:10:29 -03:00
Carlos Alexandro Becker
983cc3755d
feat(docker): retry push if 503 (#4265)
refs https://github.com/orgs/goreleaser/discussions/4263

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-09-01 11:16:16 -03:00
Carlos Alexandro Becker
ec0df9ecd5
fix: failing when pull_request.base is empty (#4261)
if the base branch is empty, it'll try to fetch the default branch,
which would fail if base repo name/owner are also empty.

the default behavior when base owner/name are missing is to using
head's, so I changed it do that before trying to get the default branch,
which should fix the issue.
2023-08-27 16:40:40 -03:00
Carlos Alexandro Becker
ecdbf5877c
feat: git.ignore_tags (#4255)
Allows to ignore tags that match the given regex expressions.
2023-08-27 15:57:03 -03:00
Carlos Alexandro Becker
c91c4b7cd8
feat: improve template error handling (#4256)
- wrap the multiple errors in an internal error with cleaner messaging
- improve testlib.RequireTemplateError and several tests
2023-08-24 22:06:12 -03:00
Carlos Alexandro Becker
53bcbe951a
feat(deps): update go-github to v54 (#4251)
<!--

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-08-24 10:50:36 -03:00
Carlos Alexandro Becker
ddbb7c8f6f
fix: improve example config used in init
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-16 13:52:42 +00:00
Carlos Alexandro Becker
f0d0cac469
feat: update to go 1.21 (#4244)
update to go 1.21

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-15 11:15:04 -03:00
Carlos Alexandro Becker
cb093219c1
fix: snapshot should run before before hooks (#4250)
Otherwise .Version will be wrong.

closes #4247
2023-08-15 10:24:53 -03:00
Carlos Alexandro Becker
08e307ea8d
Revert "fix: skip defaults for skipped pipes (#4210)"
This reverts commit dccd68c126.

This breaks `continue` on goreleaser-pro.

Will re-work this for the next release.
2023-08-09 02:43:34 +00:00
Carlos Alexandro Becker
dccd68c126
fix: skip defaults for skipped pipes (#4210)
closes #4208

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-08 22:43:39 -03:00
Carlos Alexandro Becker
c06ba3a94f
feat: publishers.disable (#4239)
allows to disable a specific custom publisher based on a template, akin
to other pipes.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-08 22:43:09 -03:00
Carlos Alexandro Becker
e7ceead889
test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-07 12:11:10 +00:00
Carlos Alexandro Becker
bbe2ee7bfb
refactor: properly annotate deprecated options
Removed unused, deprecated stuff.
2023-08-04 14:47:54 +00:00
Boshi Lian
65544aeec0
fix: docker respects builds binary file paths (#4218)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->

`docker` packaging does not honor the path structure defined in
builds/binary
it copies all binaries to temp docker build folder

this PR fixes the behavior and make it same as `archive` 

for example

```
builds:
- id: xxx 
  binary: plugins/xxx
```

before:

```
/tmp/goreleaserdocker2210262014/xxx
```

after:

```
/tmp/goreleaserdocker2210262014/plugins/xxx
```


<!-- If applied, this commit will... -->



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



<!-- # Provide links to any relevant tickets, URLs or other resources
-->
2023-08-03 09:19:07 -03:00
Carlos Alexandro Becker
d0a86edd90
feat(snapcraft): allow to disable (#4228)
allows to disable a snapcraft configuration based on a template, e.g. if
snapshot, nightly, etc
2023-08-03 09:17:26 -03:00
Carlos Alexandro Becker
1d17b311e3
fix(nix): multiple archives for the same platform (#4227)
this fixes is specially useful for universal binaries that replace the
separated binaries.

closes #4226
2023-08-02 22:58:10 -03:00
Carlos Alexandro Becker
79688e0ae5
test(docker): fix broken test
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-08-03 01:57:40 +00:00
Carlos Alexandro Becker
c6655bc094
feat(nix): support zip packages (#4225)
closes https://github.com/goreleaser/goreleaser/issues/4224
2023-08-02 20:42:35 -03:00
Carlos Alexandro Becker
51d9fc67a9
feat(deps): use mergo 1.0.0 2023-07-31 16:32:36 +00:00
Carlos Alexandro Becker
d7921d4638 feat(brew): extra_install
Allows to add manpages and shell completion installs without overriding
the default bin.install.
2023-07-31 09:40:35 -03:00
Carlos Alexandro Becker
025b8757b8
fix(nix): improve extra_install 2023-07-30 03:04:59 +00:00
Carlos Alexandro Becker
8a4c874a13 fix(nix): potentially unused with lib 2023-07-26 11:32:37 -03:00
Carlos Alexandro Becker
f107338870 fix(nix): fmt
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-26 11:32:37 -03:00
Carlos Alexandro Becker
94f080d77c feat(nix): extraInstall 2023-07-26 11:32:37 -03:00
Carlos Alexandro Becker
e672699b0a feat(nix): runtime dependencies
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-26 11:32:37 -03:00
Carlos Alexandro Becker
5e27651dae
fix: using token log message
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-26 00:34:40 +00:00
Carlos Alexandro Becker
4266634752
feat: improve output (#4206)
- improves deprecation warning styles a bit so they caught the readers
eye faster and are easier to read
- warns if the user uses `builds.target` in conjunction with other
options which are ignored in that case
- improved env output
- improved no configuration found warning

some of the changes:

<img width="1263" alt="CleanShot 2023-07-24 at 21 38 41@2x"
src="https://github.com/goreleaser/goreleaser/assets/245435/40465853-7177-44d6-b07b-61b67590669a">

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-25 08:26:44 -03:00
Carlos Alexandro Becker
a726a29d70
fix(winget): improve commit msgs (#4199)
closes  #4198
2023-07-19 22:04:45 -03:00
Carlos Alexandro Becker
7a2fc10625
feat(winget): PortableCommandAlias (#4196)
needs #4195

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-18 16:43:36 -03:00
Carl Tashian
00bc248c1b
fix(winget): replace forward slashes in Winget RelativeFilePath (#4195)
If an archive filename contains `/` characters, they can sneak into
Winget's `RelativeFilePath`.
In this PR, I make sure that `RelativeFilePath` only uses `\` directory
separators.
2023-07-18 15:34:07 -03:00
Carlos Alexandro Becker
3ed6751bb9
feat(nfpm): allow to template scripts names 2023-07-18 00:44:11 +00:00
Carlos Alexandro Becker
58a6ba4e30
feat(scoop): support arm64 (#4193)
adds arm64 support to scoops.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-17 21:26:18 -03:00
Carlos Alexandro Becker
8e0b9405f9
fix: use t.TempDir
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-17 11:56:06 +00:00
Carlos Alexandro Becker
a0f0d01a81
refactor: dockefile tmpl 2023-07-17 02:31:00 +00:00
Carlos Alexandro Becker
cbb09b89fd
fix(docker): should use cmd.Environ() instead of cmd.Env
refs #4187
2023-07-17 02:26:48 +00:00
Carlos Alexandro Becker
609e7c5657
feat: metadata mod_timestamp (#4188)
closes #4167

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-15 16:53:52 -03:00
Carlos Alexandro Becker
b9a08c4dc9
refactor: gio.Chtimes (#4191)
we're repeating this quite a bit

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-15 16:33:40 -03:00
Carlos Alexandro Becker
3c1ebe82cd
feat: support setting mod_timestamp in universalbinary (#4172)
refs #4167

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-13 23:23:41 -03:00
Carlos Alexandro Becker
52792f4a15
fix(nfpm): lintian unix path (#4175)
closes #4174
needs https://github.com/goreleaser/nfpm/pull/690

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-13 23:03:40 -03:00
Carlos Alexandro Becker
53ef7fe172
fix(nfpm): rpm.packager binding was missing
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-14 01:56:04 +00:00
Carlos Alexandro Becker
cc18ad5184
feat(nfpm): update + rpm prefixes support
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-14 01:55:47 +00:00
Hidde Beydals
326a8c885e
feat: support make_latest for GitHub release (#4161)
This commit adds a `make_latest` boolean to the release configuration,
to allow signaling to GitHub if the release should be marked as latest.

Albeit being a boolean, the internal Go type is a string to allow
to distinguish an empty string (default behavior: `true`) from an
explicit `false`.

For more information around the GitHub API field, see

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release

I did not include the `legacy` option, to not adopt something which
appears to be scheduled for removal in the future.

In addition, I opted for `make_latest` over `latest` because the
option is only available for GitHub. Which keeps the latter key
reserved for e.g. future use of a config option which is used across
Git providers.

Fixes #4159

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-14 01:45:57 +00:00
Hidde Beydals
9f6a810fbc
Support make_latest for GitHub release (#4161)
This commit adds a `make_latest` boolean to the release configuration,
to allow signaling to GitHub if the release should be marked as latest.

Albeit being a boolean, the internal Go type is a string to allow
to distinguish an empty string (default behavior: `true`) from an
explicit `false`.

For more information around the GitHub API field, see

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release

I did not include the `legacy` option, to not adopt something which
appears to be scheduled for removal in the future.

In addition, I opted for `make_latest` over `latest` because the
option is only available for GitHub. Which keeps the latter key
reserved for e.g. future use of a config option which is used across
Git providers.

Fixes #4159

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-13 22:42:20 -03:00
Carlos Alexandro Becker
a3a15fb18b
test: improve test func names for clients
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-14 01:42:00 +00:00
Carlos Alexandro Becker
ecb8dc54d7
test: fix another gitea test 2023-07-14 01:36:48 +00:00
Carlos Alexandro Becker
cd49d184b8
test: fix broken gitea test due to api changes
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-07-14 00:33:34 +00:00
Carlos Alexandro Becker
8752504b81
fix: docker.env should be first
refs #4187
2023-07-14 00:25:40 +00:00
Marcos Nils
789a4d45fe
ci: append envs when calling docker instead of overriding (#4187)
This is causing issues when trying to run tests in Dagger.
ref:
https://github.com/goreleaser/goreleaser/pull/4186#discussion_r1262977616

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2023-07-13 21:22:47 -03:00
Jimmi Dyson
f170c92db9
fix: delete temporary dir used for docker build (#4178)
<!--

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

Delete the temporary directory used for building Docker images.

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

Leaving the temporary directory leads to wasted disk space.

<!-- # Provide links to any relevant tickets, URLs or other resources
-->
2023-07-11 14:12:21 -03:00
Carlos Alexandro Becker
a324009978
fix(winget): add missing fields, more templates (#4164)
This adds missing fields:

- LicenseURL
- CopyrightURL
- Tags

As well as make several more fields templateable.


cc/ @twpayne

Co-authored-by: Tom Payne <tom.payne@flarm.com>
2023-07-05 23:33:18 -03:00
Carlos Alexandro Becker
86beb584bf
fix: improve error message
refs #4160
2023-07-03 19:01:11 +00:00
Tom Payne
c57cdab0c6
refactor: add function to apply template multiple times (#4158)
If applied, this commit simplifies the code required to support
templated fields in configuration files. This should make it easier to
add more templated fields in the future.

As [discussed first on
Discord](https://discord.com/channels/890434333251362866/1032457293687685191/1124033219747127316).
2023-06-30 14:46:53 -03:00
Carlos Alexandro Becker
5f7be841d8
fix(nix): description, path and homepage should allow templates (#4156)
- nix.description, nix.path, and nix.homepage should allow templates
- nix.path was defaulting to wrong value, fixed

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-29 14:15:53 -03:00
Carlos Alexandro Becker
f883131e73
fix(github): check rate limit again after sleeping (#4152)
also ensure sleep > 0

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-29 14:00:23 -03:00
Carlos Alexandro Becker
e9760a167b
refactor(winget): minor improvements (#4157)
improved readability a bit

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-29 13:59:33 -03:00
Carlos Alexandro Becker
a6e6e7098d
feat(deps): update env to v9
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-28 16:29:19 +00:00
Radu Jipa
3d77e8e194
fix: Scoop releases being skipped via disabled SCM releases (#4150)
The check to skip Scoop releases when SCM ones are disabled seems to be
the only place where this is happening and in conflict to Brew releases.
These two need not be linked as users can configure the `url_template`
to point elsewhere.

--- 

Consider the following use case:

```
 * goreleaser/my-app.yml
   - builds: spec for building a Go binary for my-app
   - dockers: spec for packaging my-app in a container and pushing to Artifactory & GCP
   - archives: spec for zipping up my-app binary
   - artifactories: spec for pushing archives of my-app to a private jfrog artifactory
   - brews: spec for publishing my-app through brew on macOS with URLs from artifactory
   - scoop: spec for publishing my-app through scoop on Windows with URLs from artifactory
   - release: disabled SCM (e.g. GitHub) release
```

Running `goreleaser release -f goreleaser/my-app.yml` with the above
setup results in the correct artifacts (archives & containers) being
published to Artifactory, GCP, Brew, but no Scoop.

Given that Scoop's `skip_upload` cannot be templated in 1.18 and I do
not wish to have SCM releases & tags on every release, one can be rather
stuck.
2023-06-28 09:44:59 -03:00
Carlos Alexandro Becker
7671b54056
test(ko): fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-26 17:47:12 +00:00
Carlos Alexandro Becker
7d485d6399
fix(winget): default commit message
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-26 17:09:18 +00:00
Carlos Alexandro Becker
faf3d2a52c
test(ko): fix error msg
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-26 16:58:19 +00:00
Carlos Alexandro Becker
d085b3ad44
feat(deps): bump github.com/google/go-github/v53 50.1.0 to 53.2.0 (#4146)
updated!

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-26 13:41:47 -03:00
Carlos Alexandro Becker
6cd9674c97
chore: fix lint 2023-06-25 12:55:40 +00:00
Eng Zer Jun
73e59160de
test: use t.Setenv to set env vars (#4140)
We have been using `t.Setenv` is most of our tests. This PR replaces the
remaining `os.Setenv` with `t.Setenv`.

Reference: https://pkg.go.dev/testing#T.Setenv

```go
func TestFoo(t *testing.T) {
	// before
	os.Setenv(key, "new value")
	defer os.Unsetenv(key)
	
	// after
	t.Setenv(key, "new value")
}
```

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-25 09:54:10 -03:00
Carlos Alexandro Becker
cc570c3ba4
fix(nix): missing artifact type stringer 2023-06-25 05:42:49 +00:00
Carlos Alexandro Becker
e9b4bc05da
fix: use commit msg as PR title 2023-06-25 05:16:37 +00:00
Carlos Alexandro Becker
2eaefa94b1
fix(winget): release notes should be optional
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-25 05:15:17 +00:00
Carlos Alexandro Becker
e525b66631
fix(winget): incorrect filenames (#4139)
- needs to use package identifier in the filename
- locale file need `locale` in its name

found out testing it in
https://github.com/microsoft/winget-pkgs/pull/110633
2023-06-25 01:27:08 -03:00
Carlos Alexandro Becker
4dc31e99b7
fix(nix): local filename when path not set 2023-06-25 04:26:31 +00:00
Carlos Alexandro Becker
528b06a075
fix(snapcraft): title and icon are optional (#4138)
It will otherwise create the empty fields in the yaml, and snapcraft
then complains they are empty and fail.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-24 23:38:24 -03:00
Carlos Alexandro Becker
76ce66c060
fix: improve brew/krew/scoop/nix/winget paths inside dist (#4137)
mimic the structure to be created in the target repo, and put each of
them in its own folder.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-24 23:38:09 -03:00
Carlos Alexandro Becker
f33a534825
fix: umask nfpm field (#4136)
nfpm was updated, but we never allowed to configure the umask field in
goreleaser.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-22 09:08:31 -03:00
Carlos Alexandro Becker
72cf8404c1
feat: continue on error (#4127)
closes #3989

Basically, when some of these pipes fail, the error will be memorized,
and all errors will be thrown in the end.

Meaning: the exit code will still be 1, but it'll not have stopped in
the first error.

Thinking of maybe adding a `--fail-fast` flag to disable this behavior
as well 🤔

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-20 09:33:59 -03:00
Carlos Alexandro Becker
42822497ae
feat(aur): single commit per package (#4126)
using the new multiple files api to have a single commit/push for all
files of a package.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-19 14:03:22 -03:00
Carlos Alexandro Becker
739490290f
test: improve more tests (#4124) 2023-06-18 11:58:17 -03:00
Carlos Alexandro Becker
c6851f5eee
fix(nix): hc should report nix-prefetch-url as a dependency
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-17 23:23:14 +00:00
Carlos Alexandro Becker
e5c9338efd
feat: changelog.include (#4122)
closes https://github.com/goreleaser/goreleaser/issues/4111
refs https://github.com/orgs/goreleaser/discussions/4110
recreated #4115

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-16 13:31:23 -03:00
Carlos Alexandro Becker
2ad313a7e2
test: syscall.EACCES and os.ErrNoExist (#4120)
extracted from #3795

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-15 23:53:20 -03:00
Carlos Alexandro Becker
bad7984962
test: improve executable not found checks (#4119)
extracted from #3795
2023-06-15 23:51:07 -03:00
Carlos Alexandro Becker
bb33419beb
fix: archives should always use forward slash (#4116)
extracted from #3795

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-15 23:43:29 -03:00
Carlos Alexandro Becker
ef3c42f22e
fix: artifact.Path should filepath.ToSlash (#4117)
this is needed when we run part of the pipeline on windows, and the rest
on linux, for example, the split build pro feature.

extracted from https://github.com/goreleaser/goreleaser/pull/3795 

+ added tests for relative path thing

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-15 23:43:06 -03:00
Carlos Alexandro Becker
e5a0f662fd
test: ECONNREFUSED (#4118)
improved test check

extracted from #3795
2023-06-15 23:42:55 -03:00
Carlos Alexandro Becker
0f5b058363
feat(winget): support arm64
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-15 03:34:12 +00:00
Carlos Alexandro Becker
6afdb49c12
feat: winget support (#4081)
this will add support to winget into goreleaser.

Basically, the plan is:

- we generate the 3 needed yaml files 
- we commit them to a repo

and that's it.

Initially, will probably have limited options support, and will only
have the default locale.

###### TODO

- [x] docs
- [x] review by someone who knows how this works?
- [x] test install somewhere
- [x] more tests maybe?
- [x] PR templates via API?
https://github.com/goreleaser/goreleaser/pull/4105
- [x] real project test 
- [x] setup goreleaser to pr to winget as well
- [x] document sync fork stuff
https://github.com/goreleaser/goreleaser/pull/4106

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-14 23:59:55 -03:00
Carlos Alexandro Becker
81bd82b13b
fix(nix): improve error message
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-15 02:55:32 +00:00
Carlos Alexandro Becker
823bc6062d
feat: make git client support creating multiple files in a single commit (#4107)
extracted from #4081

a little bit of a better impl than there, actually...
2023-06-14 23:52:35 -03:00
Carlos Alexandro Becker
bbcc45b677
feat: support pull request templates (#4105)
check if there is a `.github/PULL_REQUEST_TEMPLATE.md` file, and use it
as body of the pull request if there is.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-14 23:28:38 -03:00
Carlos Alexandro Becker
51592e1424
feat: envOrDefault template function (#4097)
You can achieve the same with `{{ with (index .Env "NAME") }}etc`, but
this looks cleaner.

refs #4096
2023-06-14 00:16:01 -03:00
Carlos Alexandro Becker
62b065dad0
feat: deprecate brews.tap, krews.index & scoops.bucket (#4099)
It should make goreleaser easier to use, as a `repository` is now always
called `repository`.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-14 00:13:21 -03:00
Carlos Alexandro Becker
aae9433a55
fix: archive extraformat when using format override 2023-06-13 12:16:05 +00:00
Carlos Alexandro Becker
e9c5a922f9
Revert "feat: add winget to pipeline"
This reverts commit 62f4bd5a66.

wrong commit sha
2023-06-13 12:15:28 +00:00
Carlos Alexandro Becker
62f4bd5a66
feat: add winget to pipeline 2023-06-13 03:47:35 +00:00
Adam Bouqdib
d4bbf44d65
feat(snapcraft): support title, icon, assumes & hooks (#3930)
This PR adds support for a few missing snapcraft fields which were
required for my project.
Reference here: https://snapcraft.io/docs/snapcraft-yaml-reference
2023-06-12 09:03:24 -03:00
Carlos Alexandro Becker
68b38c0229
test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-07 02:57:51 +00:00
Carlos Alexandro Becker
eadd377730
feat: remove deprecated rlcp options (#4076)
removing another deprecated option

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-06 13:54:43 -03:00
Carlos Alexandro Becker
66cee9493c
feat: remove deprecated replacements (#4075)
since this will be a late, big release, let's remove the deprecated
stuff that expired

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-06 11:46:02 -03:00
Carlos Alexandro Becker
b1c8e9f25b
feat: added IsNightly to OSS template variables
This should make it easier to use the same config file with both oss and
pro versions when only the nightly feature is used, e.g. in #3501.

Currently, that would fail because `IsNightly` is not a template field,
so you won't really be able to do it without keeping a second
`.goreleaser.yml` file. With this change, `IsNightly` always eval to
false on OSS, and keeps working as before on Pro.
2023-06-06 01:07:26 -03:00