Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add builds.no_main_check and builds.command #3064

Merged
merged 2 commits into from Apr 26, 2022
Merged

feat: add builds.no_main_check and builds.command #3064

merged 2 commits into from Apr 26, 2022

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Apr 25, 2022

Added two more options to the builds section:

  • command: allow to override the command being run. E.g. instead of
    go build, one could run go test -c by setting gobinary, command
    and flags, respectively.
  • no_main_check: by default, goreleaser will fail if there's no main
    function.

This option allows to disable that check. This PR effectively make GoReleaser able to release Go test binaries instead of just "regular" binaries.

Example usage:

image

closes #3037

Added two more options to the builds section:
- command: allow to override the command being run. E.g. instead of
  `go build`, one could run `go test -c` by setting gobinary, command
  and flags, respectively.
- no_main_check: by default, goreleaser will fail if there's no main
  function. This option allows to disable that check.

This PR effectively make GoReleaser able to release Go test binaries
instead of just "regular" binaries.

closes #3037

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@caarlos0 caarlos0 self-assigned this Apr 25, 2022
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 25, 2022
@vercel vercel bot temporarily deployed to Preview April 25, 2022 01:28 Inactive
@caarlos0 caarlos0 added the enhancement New feature or request label Apr 25, 2022
@caarlos0 caarlos0 marked this pull request as ready for review April 25, 2022 01:29
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 25, 2022
@vercel vercel bot temporarily deployed to Preview April 25, 2022 01:49 Inactive
@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #3064 (a351254) into main (41f7c3a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3064      +/-   ##
==========================================
+ Coverage   84.53%   84.54%   +0.01%     
==========================================
  Files         112      112              
  Lines        9199     9205       +6     
==========================================
+ Hits         7776     7782       +6     
  Misses       1149     1149              
  Partials      274      274              
Impacted Files Coverage Δ
pkg/config/config.go 88.44% <ø> (ø)
internal/builders/golang/build.go 91.39% <100.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41f7c3a...a351254. Read the comment docs.

@caarlos0 caarlos0 merged commit 30630bf into main Apr 26, 2022
@caarlos0 caarlos0 deleted the build.test branch April 26, 2022 01:07
@github-actions github-actions bot added this to the v1.9.0 milestone Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Releasing Compiled Test Binaries
1 participant