-
Notifications
You must be signed in to change notification settings - Fork 95
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?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1311 +/- ##
==========================================
- Coverage 72.49% 72.29% -0.21%
==========================================
Files 302 302
Lines 11007 11015 +8
==========================================
- Hits 7980 7963 -17
- Misses 2152 2165 +13
- Partials 875 887 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Some considerations:
|
5f9b15c to
be4a77e
Compare
scripts/manpages.go
Outdated
| s, _ := state.New(config.New()) | ||
| rootCommand := cli.NewRootCommand(s) | ||
|
|
||
| err := doc.GenManTree(rootCommand, nil, "./manpages") |
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.
The man pages have a 23-Jan-2026 Auto generated by spf13/cobra comment included. Is it possible to remove them, similar to how we are doing it for the markdown files?
cli/internal/scripts/generate_docs.go
Lines 52 to 72 in 097f2f0
| // Remove the 'Auto generated by...' lines at the bottom of files | |
| // This is done because this line contains the current date, which would create a diff when the file is re-generated | |
| generatedOnRegex := regexp.MustCompile(`\n###### Auto generated by spf13/cobra on .*\n`) | |
| for _, f := range files { | |
| if f.IsDir() { | |
| continue | |
| } | |
| path := filepath.Join(dir, f.Name()) | |
| bytes, err := os.ReadFile(path) | |
| if err != nil { | |
| return fmt.Errorf("could not read file at %q: %w", path, err) | |
| } | |
| bytes = generatedOnRegex.ReplaceAll(bytes, nil) | |
| // We do this to wrap tables in a code block. Otherwise, they won't be displayed properly in markdown viewers. | |
| bytes = []byte(strings.ReplaceAll(string(bytes), "┌", "```\n┌")) | |
| bytes = []byte(strings.ReplaceAll(string(bytes), "┘", "┘\n```")) | |
| err = os.WriteFile(path, bytes, f.Type()) | |
| if err != nil { | |
| return fmt.Errorf("could not write file at %q: %w", path, err) | |
| } | |
| } |
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.
Additionally, could you have a look at the table output in man hcloud-config? It is pretty wonky right now.
|
The manpage output (as well as the generated markdown docs) would have a way better table view if the tables are printed using markdown format. Our table renderer already supports this, we just need to find a way to switch between the pretty print and markdown. I used a custom config option for now but it doesn't seem to work, because viper is not loaded if you only generate docs/manpages. I'll have a look at this another time. |
This PR adds the following package files to releases:
hcloud-cli-1.59.0-1.aarch64.rpmhcloud-cli-1.59.0-1.x86_64.rpmhcloud-cli_1.59.0_amd64.debhcloud-cli_1.59.0_arm64.deb