<!--
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>
The PR enables
[`nolintlint`](https://golangci-lint.run/usage/linters/#nolintlint)
linter and fixes up appeared issues.
Changes:
- Enable `nolintlint` in `.golangci.yml` config.
- Remove unused `//nolint:` comments.
- Fix `nolint` comment format by removing spaces (`// nolint: dupl` ->
`//nolint:dupl`)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
using the same output as most cloud-native Go-written CLI's use, i.e.
using
[sigs.k8s.io/release-utils](https://github.com/kubernetes-sigs/release-utils).
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This might fail on windows/wsl (see
https://github.com/uber-go/automaxprocs/issues/65), and its not too bad
if it fails, actually, so, let's just warn the error instead of exiting
1
closes#3945
Signed-off-by: Carlos Alexandro Becker
<caarlos0@users.noreply.github.com>
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
<!--
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.
* feat: allow to use ModulePath on templates
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: initial proxy build support
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: build
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: main check
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: make it more flexible
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: small improvements
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: copy go.sum
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: root mod proxy
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: test
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: snapshots
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: proxy main pkg
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: environment variables
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: added some tests to go mod proxy feature
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: improve test
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: linte
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: goreleaser.yml
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: simplify tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: test build
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: revert unwanted changes
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: allow to run when no mod.suym
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: example
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: not a go module on go 1.15
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: improve docs as per comments
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: lint on specific ci step
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: run on push
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: contributing
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: contributing
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: action
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint issues
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint issues
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>
* 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>
* feat: improve check command
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: main test
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: tests, finally
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* Added new flags to support release notes header and footer.
Created two flags for release generation.
--release-footer
--release-header
These flags can help you to add custom changelog text before/after changes that are generated by git log.
* Fix changelog.go to avoid lint errors
* Fix test typo
* Added tests for main, fixed bug with no passing options to release ctx
* Add @caarlos0 suggestions
* feat: add goreleaser check
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: added to deprecations.md
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: added to bug.md
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: added tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: merging archive in the same repo
* refactor: merging archive in the same repo
* refactor: better organizing packages
* refactor: fixing renames
* fix: new dep version
* fix: makefile
* fix: zip/tar tests
* fix: gitigonore
* fix: s3 tests
* fix: archive test
Supports doing simple http put requests for uploading artifacts.
Heavily based con Artifactory pipeline.
In archive mode uploads all archives and the checksums file.
In binary mode uploads just the binaries.
The new flag `--skip-sign` as the same effect as saying
`artifacts: none`. It lets non GPG key owners (like Travis)
use it.
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
For some reason when building . instead of main.go,
the main_packr.go file was being ignored it seems.
Also changed it to run with go generate.
refs #591