This commit fixes the automatic extension when building the wasip1_wasm
target.
Additionally, in future Go versions, support will be added for
generating c-shared WASM binaries.
https://github.com/golang/go/issues/65199
Therefore, this PR corrects the extension in the build process and
removes the .h file from the release when c-shared is enabled and the
target is WASM.
<!--
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 cleans up unnecessary loop variable copying and enables the
[`copyloopvar`](https://golangci-lint.run/usage/linters/#copyloopvar)
linter for detecting this redundant variable copying.
#### Additional notes
After the project upgraded to Go version 1.22 in #4779, copying
variables inside a `for` loop became unnecessary. See this [blog
post](https://go.dev/blog/loopvar-preview) for a detailed explanation.
The `copyloopvar` linter is only available from `golangci-lint` v1.57
onwards, so we also need to update this tool.
Laying the ground work to allow skipping more pipes without adding new
flags et al.
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This option was still being supported, even though undocumented, for
many years now.
I think it's finally time to sunset it for good, in 6 months :)
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
GoReleaser evolved a lot since the last time I tried to implement this
>1 year ago.
Now its 100% possible, and way simpler to do it!
closes#3580
refs #2583
Signed-off-by: Carlos A 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.
-->
<!-- If applied, this commit will... -->
This PR improves the handling of shared or static libraries by
GoReleaser. It uses the default behaviour of the Go compiler by
appending the right extension to libraries.
* `.so` and `.a` for Linux shared libraries and static libraries
respectively
* `.dylib` and `.a.` on Darwin
* `.dll` and `.lib` on Windows (pre-existent)
It does not add any configuration option to `.goreleaser.yml`, since it
leverages the existing `buildmode` flag.
Additionally, this PR takes care of adding the generated header file
into the archive.
<!-- Why is this change being made? -->
Personally I would leverage this change to release some software both as
a CLI and as a shared library. I believe others who use CGo or need
interoperability with Go from other languages could benefit from this.
<!-- # Provide links to any relevant tickets, URLs or other resources
-->
This was previously discussed in #3497.
I couldn't quite think of a proper way to add some tests to the header
archiving feature. Any recommendation?
* Trying to fix parallelism on multiple builds issue
https://github.com/goreleaser/goreleaser/issues/3209
* bugfixing
* Update internal/pipe/build/build_test.go
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* Update internal/pipe/build/build_test.go
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* Update internal/pipe/build/build_test.go
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: gofumpt
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: JD <jdpcbs@gmail.com>
* 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>
- on universal binaries, use the build id instead of the binary name to
create the folder in the dist folder
- on builds, default the id the to the binary name instead of project
name. The binary name already defaults to the project id if empty, so
this should only prevent having to specify the id + binary name in
some cases.
closes#3061
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
all other logs print relative paths, only the build logs are printing the abs path.
this makes things more even.
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* 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>
* refactor: improve build
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: coverage
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: moving some cmd logs to debug
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: moving some cmd logs to debug
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Saving again the full path of the binary in the artifact name, if needed, we can filepath.Base it and get the name only.
refs #2280closes#2311
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* Implemented build option output_path
* feat: output path renamed to dist_path
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: CR
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: binary name
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
Co-authored-by: Thomas Meckel <tmeckel@users.noreply.github.com>
* feat: validate goos, goarch, goarm and gomips
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* 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>
This helps in situations where hook couldn't run at all,
e.g. because of insufficient permissions.
Previously such failure would only be reported as
empty stdout/stderr output - this allows exposure
of the real root cause.
* fix: checksum pipe will not return an error when artifact list is empty
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
* new: build.skip option for libraries
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
* docs: update doc with build.skip option
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
* fix: non-templateable field as default build.id
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: added test for build.id
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: fixed test
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: multiple archives
* fix: several things
* test: fixed
* fix: several things
* fix: archive id on the artifact
* fix: deprecated since
* docs: deprecations page improvements