-
Notifications
You must be signed in to change notification settings - Fork 94
feat: build .deb and .rpm release files #1311
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| /hcloud | ||
| /dist | ||
| /bats | ||
| /completions | ||
| /manpages | ||
| /cmd/hcloud/hcloud | ||
| hcloud_cli.p12 | ||
| coverage.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
| set -e | ||
| rm -rf completions | ||
| mkdir completions | ||
| for sh in bash zsh fish; do | ||
| go run ./cmd/hcloud completion "$sh" >"completions/hcloud.$sh" | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "log" | ||
| "os" | ||
| // We import md2man here so we can keep it up to date in go.mod | ||
| _ "github.com/cpuguy83/go-md2man/v2/md2man" | ||
|
|
||
| "github.com/spf13/cobra/doc" | ||
|
|
||
| "github.com/hetznercloud/cli/internal/cli" | ||
| "github.com/hetznercloud/cli/internal/state" | ||
| "github.com/hetznercloud/cli/internal/state/config" | ||
| "github.com/hetznercloud/cli/internal/version" | ||
| ) | ||
|
|
||
| const directory = "./manpages" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about running this and Related to the above, is there a reason to put these two files and
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it could use some clean up, I'll do that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two things:
|
||
|
|
||
| func main() { | ||
| //nolint:gosec | ||
| if err := os.MkdirAll(directory, 0755); err != nil { | ||
| log.Fatal(err) | ||
| } | ||
|
|
||
| ctx := context.Background() | ||
| ctx = context.WithValue(ctx, state.ContextKeyMarkdownTables{}, true) | ||
| s, _ := state.New(ctx, config.New()) | ||
| rootCommand := cli.NewRootCommand(s) | ||
|
|
||
| err := doc.GenManTree(rootCommand, &doc.GenManHeader{ | ||
| Source: version.Version, | ||
| Manual: "CLI for Hetzner API", | ||
| }, directory) | ||
|
|
||
| if err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| fmt.Println("Man pages generated successfully") | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can already manually bump the version, even if the dependency is marked as
indirectThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But renovate will only pick up direct dependencies, right? Also it would be nice to have it documented so that it doesn't randomly break in the future and nobody knows/notices.