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

Setup goreleaser for gwctl to generate binaries for various platforms #3038

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gauravkghildiyal
Copy link
Member

What type of PR is this?
/kind feature

What this PR does / why we need it:

  • Introduce gwctl version command to print binary information.
    ❯ gwctl version
    Version: 1.0.0-SNAPSHOT-ca344b9a
    Git Commit: ca344b9aa43ad5acc81235b25097fd20d8e97068
    Build Date: 2024-05-01T06:29:53Z
    
  • Setup goreleaser to build binaries for various platforms

NOTES for the reviewer:

  • LICENSE file is added to the gwctl subdirectory so that it get's included in the archives generated by goreleaser.
  • Actual steps of how maintainers will make use of goreleaser to generate the binaries will be added independently (likely after some discussion)

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 1, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauravkghildiyal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/gwctl size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 1, 2024
Comment on lines +11 to +12
- go mod tidy
- go build -o ./dist/gwctl ./main.go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, both this and the repo CI should probably include a test suite. Much larger change, non-blocking for this one, but something to put on your todo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely yes.

@youngnick
Copy link
Contributor

/lgtm
/hold for further review though

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2024
@gauravkghildiyal
Copy link
Member Author

/retest

# For local testing, use:
#
# goreleaser release --snapshot --clean
project_name: gwctl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we intend to keep gwctl as a standalone binary or as a kubectl plugin? If it is both, then wouldn't it be better to name the binary kubectl-*?

Comment on lines +100 to +110
func newVersionCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "version",
Short: "Print the version information of gwctl",
Long: `Print the version information of gwctl, including version, git commit and build date.`,
Run: func(*cobra.Command, []string) {
fmt.Println(version.GetVersionInfo())
},
}
return cmd
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Shouldn't this be moved to a separate file like the rest of the subcommands?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/gwctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. 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.

None yet

4 participants