Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Overview **UPDATE** This PR adds building binaries to the release process by using [goreleaser](https://goreleaser.com/). The CI release process is largely unchanged. Releases can be trigger by either manually triggering the `ci_release` workflow, or they can be triggered by pushing a version tag. If the team has not been using the CI to generate releases, so I added a `make goreleaser-release` command to build the binaries for the release locally so that they can be manually uploaded. Result of running `make goreleaser-release`: ``` build └── goreleaser ├── artifacts.json ├── celestia-node_Darwin_arm64.tar.gz ├── celestia-node_Darwin_x86_64.tar.gz ├── celestia-node_Linux_arm64.tar.gz ├── celestia-node_Linux_x86_64.tar.gz ├── celestia-node_darwin_amd64_v1 │ └── celestia ├── celestia-node_darwin_arm64 │ └── celestia ├── celestia-node_linux_amd64_v1 │ └── celestia ├── celestia-node_linux_arm64 │ └── celestia ├── checksums.txt ├── config.yaml └── metadata.json ``` The `.goreleaser.yaml` file is 90% stock generated from `goreleaser init`. The celestia node specific items are: ```yaml builds: - main: ./cmd/celestia binary: celestia env: # NOTE: goreleaser doesn't fully support CGO natively. If CGO is needed # for any node features, this should be removed and a workaround might # need to be created. # REF: https://goreleaser.com/limitations/cgo/ - CGO_ENABLED=0 - VersioningPath={{ "github.com/celestiaorg/celestia-node/nodebuilder/node" }} goos: - linux - darwin goarch: - amd64 - arm64 ldflags: # Ref: https://goreleaser.com/customization/templates/#common-fields # # .CommitDate is used to help with reproducible builds, ensuring that the # same date is always used # # .FullCommit is git commit hash goreleaser is using for the release # # .Version is the version being released - -X "{{ .Env.VersioningPath }}.buildTime={{ .CommitDate }}" - -X "{{ .Env.VersioningPath }}.lastCommit={{ .FullCommit }}" - -X "{{ .Env.VersioningPath }}.semanticVersion={{ .Version }}" dist: ./build/goreleaser ``` For building locally, i added a `make goreleaser-build` command. The binaries are put into a `build/goreleaser` directory. The `make goreleaser` command lists the `goreleaser` commands and also checks the version as a way to verify you have `goreleaser` installed. Result of running `make goreleaser-build`: ``` build └── goreleaser ├── artifacts.json ├── celestia-node_darwin_amd64_v1 │ └── celestia ├── config.yaml └── metadata.json ``` Successful github action run: https://github.com/MSevey/celestia-node/actions/runs/6123729144/job/16622244813 Example release generated: https://github.com/MSevey/celestia-node/releases Created celestiaorg#2445 as a follow up discussion how to add signing. --------- Co-authored-by: Ismail Khoffi <Ismail.Khoffi@gmail.com> Co-authored-by: ramin <raminkeene@gmail.com>
- Loading branch information