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

31 Commits

Author SHA1 Message Date
Ville Skyttä
1c9b4d56b4
feat: completion improvements (#4071)
See individual commits for details.
2023-06-06 00:21:17 -03:00
Carlos Alexandro Becker
cebdf0d8a6
fix: goreleaser build index out of range (#4007)
If you run `goreleaser build --single-target` with
`universalbinaries[*].replace = true` on a mac, it'll break.

This fixes it by disabling universal binaries when building a single
target.

It isn't useful anyway.

Closes #4004

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-12 15:50:12 -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 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
6279e1a431
fix: annotate flags so they complete better (#3444) 2022-10-06 11:24:13 +02:00
Carlos Alexandro Becker
0ea3e0f572
fix: build --single-target when using specific targets (#3381)
When using specific targets in the config, single target becomes
ineffective. This should fix it. This also removes other build options
like gomips, goarm, goamd64, etc, as go will infer them from the current
OS. In theory we should one day support all the GO* flags go build
supports.
2022-09-15 22:17:40 -03:00
Carlos A Becker
d22d67d923
fix: clarifying build --single-target
Make it more clear that it will override whatever is defined in the yaml
config.
fix: clarifying build --single-target

Make it more clear that it will override whatever is defined in the yaml
config.

refs #3265

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-07-28 22:30:43 -03:00
Carlos Alexandro Becker
cf3c758356
feat: allow multiple ids to be passed to build (#3212)
* Allow multiple ids to be passed to build

goreleaser build --id build 1 --id build2

* addressing cr

* addressing cr

* fix: rename to ids

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

* fix: improve output

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

Co-authored-by: JD <jdpcbs@gmail.com>
2022-06-28 23:37:38 -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
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
Andreas Deininger
38bc6b504e
docs: fix typos (#3054) 2022-04-19 19:34:24 -03:00
Carlos A Becker
0ba753c496
fix: man pages
closes #3048

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-04-16 15:31:43 -03:00
Carlos A Becker
67382ee69e
fix: typo in goreleaser build help 2022-02-25 22:04:46 -03:00
Carlos Alexandro Becker
d6813ce54d
fix: do not copy binary by default (#2916)
* fix: do not copy binary by default

closes #2913

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

* chore: ref

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-19 15:10:37 -03:00
Carlos Alexandro Becker
c42a2fdc76
feat: allow a --output flag on goreleaser build (#2701)
* feat: allow a --output flag on goreleaser build

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

* fix: single build always to copies to root

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-05 18:19:12 -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 Alexandro Becker
ecb800aef7
feat: store artifact list into dist/artifacts.json (#2715)
* feat: store artifact list into dist/artifacts.json

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

* chore: fmt

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-12-01 09:54:58 -03:00
Carlos A Becker
eb4bee7f13
docs: improve goreleaser build readme
refs #2710

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-11-30 10:41:05 -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
860b4a8f81
chore: gofumpt & lint (#2190)
Signed-off-by: Carlos Becker <caarlos0@gmail.com>
2021-04-25 14:20:49 -03:00
Carlos Alexandro Becker
d822baf11f
docs: formatting
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-04-22 10:58:58 -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
0c2e80ae93
feat: build single target and/or build id (#2179)
* feat: build single target

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

* feat: build single id

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-04-21 16:36:53 -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