Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"

- name: Download tools
run: go -C ./tools mod download
version: v2025.5.9
Comment thread
jooola marked this conversation as resolved.
Outdated

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: 2.x
args: release --clean --snapshot --skip=sign
run: goreleaser release --clean --snapshot --skip=sign

- uses: actions/upload-artifact@v4
with:
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"
version: v2025.5.9

- name: Run gofmt
run: diff -u <(echo -n) <(gofmt -d -s .)

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required and must be specified with patch version
version: v1.64.8 # renovate: datasource=github-releases depName=golangci/golangci-lint
# golangci-lint was already installed in a previous step.
install-mode: none
# In general linting is quite fast with warm caches, but a fresh run might take some time.
args: --timeout 5m

Expand All @@ -37,10 +37,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"
version: v2025.5.9

- name: Run tests
run: go test -coverpkg=./... -coverprofile=coverage.txt -v -race ./...
Expand All @@ -62,10 +62,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"
version: v2025.5.9

- uses: hetznercloud/tps-action@main

Expand All @@ -91,10 +91,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"
version: v2025.5.9

- name: Delete old generated files
run: find . -name 'zz_*.go' -delete
Expand All @@ -114,10 +114,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"
version: v2025.5.9

- name: Run go mod tidy
run: go mod tidy
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Go
uses: actions/setup-go@v5
- name: Set up tools
uses: jdx/mise-action@v2
with:
go-version: "1.24"

- name: Download tools
run: go -C ./tools mod download
version: v2025.5.9

- name: Import GPG key
id: import_gpg
Expand All @@ -37,10 +34,7 @@ jobs:
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: 2.x
args: release --clean --skip=validate
run: goreleaser release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
QUILL_SIGN_P12: ${{ secrets.APPLE_CERTIFICATE_P12_FILE }}
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ builds:
hooks:
post:
- cmd: >
go -C ./tools run github.com/anchore/quill/cmd/quill
quill
sign-and-notarize "{{ .Path }}"
--dry-run={{ .IsSnapshot }}
--ad-hoc={{ .IsSnapshot }}
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Developing hcloud-cli

## Installing tools

We recommend installing tools using [mise](https://github.com/jdx/mise). Once mise is installed and activated
in your env, run `mise install` in this repository to install all required tools. Tools will then be automatically
added to your `PATH` when entering the directory.

## Generated files

This repository contains generated files, mainly for testing purposes. These files are generated by running
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ require (
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/tools v0.31.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,8 @@ go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
Expand All @@ -143,8 +139,6 @@ golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
38 changes: 19 additions & 19 deletions internal/hcapi2/mock/mock_gen.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package mock

//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_action_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ActionClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_certificate_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 CertificateClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_datacenter_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 DatacenterClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_image_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ImageClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_iso_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ISOClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_firewall_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 FirewallClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_floating_ip_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 FloatingIPClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_primary_ip_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PrimaryIPClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_location_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LocationClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_loadbalancer_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LoadBalancerClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_loadbalancer_type_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LoadBalancerTypeClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_network_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 NetworkClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_server_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ServerClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_server_type_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ServerTypeClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_ssh_key_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 SSHKeyClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_volume_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 VolumeClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_placement_group_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PlacementGroupClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_rdns_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 RDNSClient
//go:generate go run go.uber.org/mock/mockgen -package mock -destination zz_pricing_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PricingClient
//go:generate mockgen -package mock -destination zz_action_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ActionClient
//go:generate mockgen -package mock -destination zz_certificate_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 CertificateClient
//go:generate mockgen -package mock -destination zz_datacenter_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 DatacenterClient
//go:generate mockgen -package mock -destination zz_image_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ImageClient
//go:generate mockgen -package mock -destination zz_iso_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ISOClient
//go:generate mockgen -package mock -destination zz_firewall_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 FirewallClient
//go:generate mockgen -package mock -destination zz_floating_ip_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 FloatingIPClient
//go:generate mockgen -package mock -destination zz_primary_ip_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PrimaryIPClient
//go:generate mockgen -package mock -destination zz_location_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LocationClient
//go:generate mockgen -package mock -destination zz_loadbalancer_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LoadBalancerClient
//go:generate mockgen -package mock -destination zz_loadbalancer_type_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 LoadBalancerTypeClient
//go:generate mockgen -package mock -destination zz_network_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 NetworkClient
//go:generate mockgen -package mock -destination zz_server_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ServerClient
//go:generate mockgen -package mock -destination zz_server_type_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 ServerTypeClient
//go:generate mockgen -package mock -destination zz_ssh_key_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 SSHKeyClient
//go:generate mockgen -package mock -destination zz_volume_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 VolumeClient
//go:generate mockgen -package mock -destination zz_placement_group_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PlacementGroupClient
//go:generate mockgen -package mock -destination zz_rdns_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 RDNSClient
//go:generate mockgen -package mock -destination zz_pricing_client_mock.go github.com/hetznercloud/cli/internal/hcapi2 PricingClient
2 changes: 1 addition & 1 deletion internal/state/command_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

//go:generate go run go.uber.org/mock/mockgen -package state -destination zz_command_helper_mock.go . ActionWaiter,TokenEnsurer
//go:generate mockgen -package state -destination zz_command_helper_mock.go . ActionWaiter,TokenEnsurer

type ActionWaiter interface {
WaitForActions(context.Context, *cobra.Command, ...*hcloud.Action) error
Expand Down
2 changes: 1 addition & 1 deletion internal/testutil/terminal/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hetznercloud/cli/internal/ui"
)

//go:generate go run go.uber.org/mock/mockgen -package terminal -destination zz_terminal_mock.go . Terminal
//go:generate mockgen -package terminal -destination zz_terminal_mock.go . Terminal

type Terminal interface {
StdoutIsTerminal() bool
Expand Down
11 changes: 11 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tools]
go = "1.24.3"
Comment thread
jooola marked this conversation as resolved.
Outdated
"go:go.uber.org/mock/mockgen" = "v0.5.2" # renovate: datasource=github-releases depName=uber-go/mock
Comment thread
jooola marked this conversation as resolved.
Outdated
golangci-lint = "v1.64.8"
goreleaser = "v2.9.0"
Comment thread
jooola marked this conversation as resolved.
Outdated
"ubi:anchore/quill" = "v0.5.1" # renovate: datasource=github-releases depName=anchore/quill
"ubi:jstemmer/go-junit-report" = "v2.1.0" # renovate: datasource=github-releases depName=jstemmer/go-junit-report

[settings]
# Experimental features are needed for the Go backend
experimental = true
8 changes: 0 additions & 8 deletions tools.go

This file was deleted.

100 changes: 0 additions & 100 deletions tools/go.mod

This file was deleted.

Loading
Loading