2017-01-02 19:08:49 +02:00
|
|
|
# Contributing
|
|
|
|
|
2022-10-05 14:42:05 +02:00
|
|
|
By participating in this project, you agree to abide our
|
|
|
|
[code of conduct](https://github.com/goreleaser/.github/blob/main/CODE_OF_CONDUCT.md).
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2022-10-05 14:42:05 +02:00
|
|
|
## Set up your machine
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2024-05-12 18:22:56 +02:00
|
|
|
`goreleaser` is written in [Go](https://go.dev/).
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
That said, we have two different ways of running the tests, regular, and with
|
|
|
|
Dagger.
|
|
|
|
|
|
|
|
### Regular
|
|
|
|
|
|
|
|
Prerequisites:
|
|
|
|
|
|
|
|
- [Task](https://taskfile.dev/installation)
|
|
|
|
- [Go 1.23+](https://go.dev/doc/install)
|
|
|
|
|
|
|
|
Other things you might need to run some of the tests (they should get
|
|
|
|
automatically skipped if a needed tool isn't present):
|
|
|
|
|
|
|
|
- [cosign](https://github.com/sigstore/cosign)
|
|
|
|
- [Docker](https://www.docker.com/)
|
|
|
|
- [GPG](https://gnupg.org)
|
|
|
|
- [Podman](https://podman.io/)
|
|
|
|
- [Snapcraft](https://snapcraft.io/)
|
|
|
|
- [Syft](https://github.com/anchore/syft)
|
|
|
|
- [upx](https://upx.github.io/)
|
|
|
|
|
|
|
|
### Dagger
|
|
|
|
|
2017-10-02 12:35:20 +02:00
|
|
|
Prerequisites:
|
|
|
|
|
2023-07-12 14:47:07 +02:00
|
|
|
- [Task](https://taskfile.dev/installation)
|
2024-09-20 04:21:59 +02:00
|
|
|
- [Dagger](https://docs.dagger.io/install)
|
2024-08-18 21:08:55 +02:00
|
|
|
- [Go 1.23+](https://go.dev/doc/install)
|
2018-05-28 15:49:38 +02:00
|
|
|
- [Docker](https://www.docker.com/)
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
## Building
|
|
|
|
|
2018-10-31 04:23:47 +02:00
|
|
|
Clone `goreleaser` anywhere:
|
2017-01-02 19:08:49 +02:00
|
|
|
|
|
|
|
```sh
|
2020-08-14 23:13:02 +02:00
|
|
|
git clone git@github.com:goreleaser/goreleaser.git
|
2017-01-02 19:08:49 +02:00
|
|
|
```
|
|
|
|
|
2021-03-01 19:45:06 +02:00
|
|
|
`cd` into the directory and install the dependencies:
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2024-07-10 06:27:11 +02:00
|
|
|
```bash
|
|
|
|
go mod tidy
|
2017-01-02 19:08:49 +02:00
|
|
|
```
|
|
|
|
|
2024-07-10 06:27:11 +02:00
|
|
|
You should then be able to build the binary:
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2024-07-10 06:27:11 +02:00
|
|
|
```bash
|
|
|
|
go build -o goreleaser .
|
|
|
|
./goreleaser --version
|
2017-01-02 19:08:49 +02:00
|
|
|
```
|
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
## Testing your changes
|
2017-01-02 19:08:49 +02:00
|
|
|
|
|
|
|
You can create a branch for your changes and try to build from the source as you go:
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
```sh
|
2021-10-06 01:05:22 +02:00
|
|
|
task build
|
2017-01-02 19:08:49 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
When you are satisfied with the changes, we suggest you run:
|
|
|
|
|
2019-03-25 01:10:30 +02:00
|
|
|
```sh
|
2021-10-06 01:05:22 +02:00
|
|
|
task ci
|
2017-01-02 19:08:49 +02:00
|
|
|
```
|
|
|
|
|
2021-11-25 01:42:18 +02:00
|
|
|
Before you commit the changes, we also suggest you run:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
task fmt
|
|
|
|
```
|
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
You can also test it with Dagger:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
dagger call test
|
|
|
|
```
|
|
|
|
|
|
|
|
### A note about Docker multi-arch builds
|
|
|
|
|
|
|
|
If you want to properly run the Docker tests, or run `goreleaser release
|
|
|
|
--snapshot` locally, you might need to setup Docker for it.
|
|
|
|
You can do so by running:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
task docker:setup
|
|
|
|
```
|
|
|
|
|
2024-11-16 15:30:39 +02:00
|
|
|
### A note about Windows
|
|
|
|
|
|
|
|
Make sure to enable "Developer Mode" in Settings.
|
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
## Creating a commit
|
2017-10-01 20:15:06 +02:00
|
|
|
|
2019-06-06 06:35:50 +02:00
|
|
|
Commit messages should be well formatted, and to make that "standardized", we
|
|
|
|
are using Conventional Commits.
|
2017-10-01 20:15:06 +02:00
|
|
|
|
2019-01-01 17:19:57 +02:00
|
|
|
You can follow the documentation on
|
|
|
|
[their website](https://www.conventionalcommits.org).
|
2017-10-01 20:15:06 +02:00
|
|
|
|
2024-09-20 04:32:41 +02:00
|
|
|
## Submitting a pull request
|
2017-01-02 19:08:49 +02:00
|
|
|
|
2021-11-12 22:23:32 +02:00
|
|
|
Push your branch to your `goreleaser` fork and open a pull request against the main branch.
|
2018-01-24 00:59:29 +02:00
|
|
|
|
|
|
|
## Financial contributions
|
|
|
|
|
2022-09-04 04:27:04 +02:00
|
|
|
You can contribute in our OpenCollective or to any of the contributors directly.
|
|
|
|
See [this page](https://goreleaser.com/sponsors) for more details.
|