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

31 Commits

Author SHA1 Message Date
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
Ville Skyttä
1c9b4d56b4
feat: completion improvements (#4071)
See individual commits for details.
2023-06-06 00:21:17 -03:00
Kazuki Matsumaru
b495c905d5
fix: set parallelism to match Linux container CPU (#3901)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

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

-->

Currently Goreleaser uses `runtime.NumCPU()` as the default value if
`--parallelism` is not set.
However, this will get the number of CPUs on the host even when
Goreleaser is run in a container with a limit on the maximum number of
CPUs that can be used (typically in a Kubernetes pod).
Actually, `docker run --cpus=1 goreleaser/goreleaser --debug` shows
`parallelism: 4` on my machine.
This behavior causes CPU throttling, which increases execution time and,
in the worst case, terminates with an error.
I ran into this problem with Jenkins where the agent runs on pod
([Kubernetes plugin for
Jenkins](https://plugins.jenkins.io/kubernetes/)).

This commit introduces
[automaxprocs](https://github.com/uber-go/automaxprocs) to fix this
issue.
This library sets `GOMAXPROCS` to match Linux container CPU quota.
I have also looked for a library that can get CPU quota more directly,
but this seems to be the best I could find.
The reason it is set in a different notation from the automaxprocs
README is to prevent logs from being displayed
([comment](https://github.com/uber-go/automaxprocs/issues/18#issuecomment-511330567)).

I would have liked to write a test, but this change is dependent on the
number of CPUs in the execution environment, so I could not.
Instead, I wrote a Dockerfile for testing

```Dockerfile
FROM golang:1.20.2

WORKDIR /go/app
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
COPY . .
RUN task build
```

and confirmed built binary shows expected parallelism by following
commands:

```sh
docker build --file Dockerfile.test . -t test-goreleaser
docker run --cpus=1 test-goreleaser ./goreleaser build --snapshot --debug # parallelism: 1
docker run test-goreleaser ./goreleaser build --snapshot --debug # parallelism: 4
```

I also ran the built binary on my Macbook and it was fine.
2023-04-02 17:16:41 -03:00
Carlos A Becker
b1dc5b8daf
chore: comment
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-01-30 21:35:27 -03:00
Carlos Alexandro Becker
4954815ae4
fix: improve handling of --rm-dist deprecation (#3728)
- 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>
2023-01-29 00:24:11 -03:00
Carlos Alexandro Becker
d18adfb57e
feat: deprecate --rm-dist in favor of new --clean flag (#3702)
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>
2023-01-20 23:47:08 -03:00
Carlos Alexandro Becker
2450746e5c
feat: add ko support (#3653)
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 #2556
closes #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>
2023-01-16 22:34:49 -03:00
Carlos Alexandro Becker
da2335791a
fix: native changeloger without previous tag (#3668)
closes #3662

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-29 10:41:59 -03:00
Carlos Alexandro Becker
6279e1a431
fix: annotate flags so they complete better (#3444) 2022-10-06 11:24:13 +02:00
Carlos Alexandro Becker
a8b3806e7e
refactory: making merges with pro easier (#3400)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-25 18:19:53 -03:00
Carlos Alexandro Becker
d79484ef1d
feat: added --skip-before flag (#3182)
* feat: added --skip-before flag

this would allow to skip global before hooks

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: skip docker test

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-22 21:56:53 -03:00
Carlos Alexandro Becker
ae399220ef
feat: add --skip-docker (#3176)
Allow to skip the entire docker images and manifests builds.

Might be useful for faster local builds et al.

closes #3144

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-22 21:39:20 -03:00
Carlos Alexandro Becker
9efea360b9
refactory: make easier to manage merges with pro (#3178)
* refactory: improve cmd code

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: improve time reporting

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: improve artifacts json

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: improve artifacts json

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: diffs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* docs: improve root cmd help

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-22 01:48:11 -03:00
Carlos Alexandro Becker
fe7e2123bd
feat: replacing the log library (#3139)
* feat: replacing logs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests et al

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* feat: update termenv/lipgloss

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* wip: output

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: pin dep

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: update

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: deps

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: dep

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-21 21:11:15 -03:00
Carlos A Becker
d1291650f2
feat: migrate back to cobra
now that cobra does not require a lot of unused deps because of viper anymore, we can migrate back to it.

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-05-06 20:38:50 -03:00
Carlos Alexandro Becker
ce9058ac8c
refactor: use context on git exec calls (#3032) 2022-04-12 08:35:19 -03:00
Carlos Alexandro Becker
a5d3e7bf4b
feat: replace cobra with coral (#2881)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-04 16:31:19 -03:00
Carlos A Becker
7085b4c557
docs: improve docs for changelog skipping
closes #2601
2022-01-30 11:28:00 -03:00
Alex Goodman
bfdec808ab
feat: add sbom generation pipe (#2648)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-12-12 00:21:51 -03:00
Carlos Alexandro Becker
833db79bda
feat: removes deprecated non-semver allowance (#2503)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-09-23 00:39:28 -03:00
Carlos Alexandro Becker
61bead8989
feat: improve output and pipe skipping (#2480)
* refactor: improve middleware

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: upload tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: twitter tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: source tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: snapshot tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: improved some tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: snapcraft skip

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip slack

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip sign

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip scoop

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip reddit

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip discord

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip publish

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip nfpm

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip milestone

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip custompublishers

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip checksums

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip changelog

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip brew

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip blob

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip before

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip artifactory

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip announce

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip defaults

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: cmds

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip docker

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* chore: todo

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: go.mod

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip release

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: remove old skip pipe errors

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip teams

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip brew

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix/test: skip smtp

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip docker

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip brew and scoop

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip docker

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: skip http/artifactory

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: increase coverage

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-09-18 10:21:29 -03:00
Carlos Alexandro Becker
bad1132e78
feat: --auto-snapshot on dirty git tree (#2286)
* feat: --auto-snapshot

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* docs: fix

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: workflow

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-06-04 23:09:12 -03:00
Carlos Alexandro Becker
a2d7ccad2f
feat: --skip-announce (#2249) 2021-05-25 00:45:59 -03:00
Carlos Alexandro Becker
9913fe7db6
feat: template release notes (#2242)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-05-21 21:07:47 -03:00
Carlos Alexandro Becker
29cb60330b
docs: add cmd docs (#2184)
* docs: add cmd docs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: cmd docs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: num cpus

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: improve some things

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: improve docs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: script

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-04-22 10:45:36 -03:00
Carlos Alexandro Becker
838a244830
feat: use num cpu as default parallelism (#2015)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-13 17:21:04 +00:00
CrazyMax
f10873d919
Revert "feat: allow automatic snapshot on dirty state (#1958)" (#1962)
This reverts commit d8a0f253d1.
2020-12-22 11:04:51 -03:00
CrazyMax
d8a0f253d1
feat: allow automatic snapshot on dirty state (#1958)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-12-22 10:41:08 -03:00
Carlos Alexandro Becker
707639f4d9
fix: improve completions (#1894)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-12 20:25:27 +00:00
Radek Simko
983f342ab8
feat: Add build command (#1520)
* feat: Add build command

* feat(cmd/build): Add skip-post-hooks flag

* Update internal/pipeline/pipeline.go

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-05-15 11:19:20 -03:00
Carlos Alexandro Becker
9bd0033c09
feat: refactor main.go to spf13/cobra (#1472)
* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: revert

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: refactor cli

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: move

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-04-27 21:42:44 -03:00