here's an idea: `goreleaser healthcheck`
It'll check if the needed dependencies (docker, git, etc) are available
in the path... this way users can preemptively run it before releasing
or to debug issues.
What do you think?
Here's how it looks like:
<img width="1007" alt="CleanShot 2023-03-02 at 23 24 26@2x"
src="https://user-images.githubusercontent.com/245435/222615682-d9cd0733-d900-43d1-9166-23b2be589b3a.png">
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
If all other strategies fail, try to infer the `package_name` property
from the `go.mod` file, using its last segment as the actual package
name.
This is not perfect, but usually this will only be used when running
against a new project, with no git url, empty/default config, etc... so,
in reality, it'll rarely be used.
closes#3825
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Creating the temp dir for docker builds was required back in the day
because we symlinked the files, so to avoid different filesystems et al,
this was the easier solution.
Since many versions ago, we switched to copying the files instead, which
works a lot better.
This also means we don't need the dist check for extra files anymore, as
long as we create the temp outside dist.
All that said, this PR does 2 things:
- changes the docker pipe to create the dist in the user's tempdir
instead of dist
- removes the dist path check for docker's extra files
closes#3790closes#3791
cosign v2 update!
- need to use `--yes` to auto-approve prompts
cc/ @cpanato anything else I'm missing?
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
alternative to #3806
the idea is that both `context.New` and `context.Context{}` are never
used in tests.
not sure yet how much I like it, so far code does look a bit more
readable though.
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
it was forcing to provide the same information as env and yaml.
this should fix it.
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
I have no idea why this never happened before... the lock was
ineffective in `artifacts.List`, which should have caused at least some
race condition at some point.
Anyway, got it once locally while working on another feature, and
couldn't believe my eyes.
Fixed, thank goodness!
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This option was still being supported, even though undocumented, for
many years now.
I think it's finally time to sunset it for good, in 6 months :)
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Hi, I found a bug in the GitLab client that leads to not correctly
prepend/append/keep releases notes.
This will use the original `Description` instead of the pre-rendered
`DescriptionHTML`. Furthermore, as `include_html_description` is not
enabled, the `DescriptionHTML` field is always empty.
[GitLab
documentation](https://docs.gitlab.com/ee/api/releases/index.html#get-a-release-by-a-tag-name)
otherwise we might get warnings like
> warning: GOCOVERDIR not set, no coverage data emitted
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
update everything to go 1.20
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
do not write fields et al, let it just roll, otherwise its too noisy,
and we might expose things we are not supposed to.
closes#3741
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
The commit will add the `bare` option to ko publisher options when
set/passed via config `.goreleaser.yaml`.
Currently, even the `bare: true` is set via config, the option was never
passed to `ko` PublisherOptions.
#3742
---------
Co-authored-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
- improved how we handle `--rm-dist` deprecation so it looks more like
other deprecations
- improved deprecation error message a bit as well
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
- added a tmpl.Bool that checks if the result of a template is "true"
- added an ErrSkipper interface so Skip() methods can return errors as well
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
After talking with @perylemke, we realized that probably most people
will likely expect it to be called --clean instead of --rm-dist, as its
more similar to the popular `make clean` task.
This adds the --clean flag, and make the --rm-dist one deprecated.
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
continuing the PR by @developer-guy
- [x] should be a publisher, as it does publish the images it builds
every time
- [x] `Default` method does not work
- [x] the `fromConfig` thing should probably be on the defaults, too
- [x] wire `--skip-ko`
- [x] documentation
- [x] more tests
- [x] use same registry as docker tests does
- [ ] see if we can make the log output match goreleaser's
- [ ] ??
closes#2556closes#3490
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: actions-user <actions@github.com>
Co-authored-by: Jason Hall <jason@chainguard.dev>
Co-authored-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
To help solve this issue
```
apk:
signature:
key_file: "{{ .Env.ABUILD_KEY_NAME }}.rsa"
key_name: "{{ .Env.ABUILD_KEY_NAME }}"
```
<!--
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... -->
Allow that the key_name in apk signature to be templated
<!-- Why is this change being made? -->
The name of the key might not be hardcoded, in a github workflow
<!-- # Provide links to any relevant tickets, URLs or other resources
-->
...
# If applied, this commit will
Linked issues will be resolved.
# Why is this change being made?
Because the program will no longer have to refer to nil.
# Provide links to any relevant tickets, URLs or other resources
- https://github.com/goreleaser/goreleaser/issues/3669
This prevents one announce failure to skip all other announcers.
The release will still report a failure in the end, but will not fail in
the first failure.
Also improved errors messages a little bit.
closes#3663
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
with this patch, a config like:
```yaml
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
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 }}
rlcp: true
files:
- src: "build/**/*"
dst: .
nfpms:
- package_name: foo
contents:
- src: "build/**/*"
dst: usr/share/foo
formats:
- apk
```
will eval this:
<img width="1384" alt="CleanShot 2022-12-21 at 22 21 00@2x"
src="https://user-images.githubusercontent.com/245435/209034244-7c31b5f7-cfcd-4825-bb2f-7dd463c5286a.png">
as much as I would like to make this the default, it would be a breaking
change, so we really can't do it.
If `dst` is empty, it'll have the same behavior as before (no rlcp), and
if `strip_parent` is set, it will also still have the same behavior.
Finally, if the format is binary, `rlcp` is ignored too (as it doesn't
make sense).
So, this only changes if:
- your format is not binary; and
- you have files with `src` and `dst` set
Then, goreleaser will warn you to set `rlcp: true`.
## todo
- [x] docs
- [x] more tests probably
- [x] any ideas for a better name for the new config option?
fixes#3655
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
the warning was too trigger happy, this should fix it.
thanks @ioga for reporting it.
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>