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
89 changes: 89 additions & 0 deletions .github/workflows/cli-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CLI CI

on:
pull_request:
paths:
- "cli/**"
- ".github/workflows/cli-ci.yml"
push:
branches:
- main
paths:
- "cli/**"
- ".github/workflows/cli-ci.yml"

permissions:
contents: read

concurrency:
group: cli-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: cli/go.mod
cache-dependency-path: cli/go.sum

- name: Test
run: go test ./...

- name: Vet
run: go vet ./...

- name: Install staticcheck
run: GOBIN=$PWD/.bin go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Staticcheck
run: ./.bin/staticcheck ./...

build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: windows
goarch: amd64
defaults:
run:
working-directory: cli

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: cli/go.mod
cache-dependency-path: cli/go.sum

- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p dist
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
go build -o dist/tc-${{ matrix.goos }}-${{ matrix.goarch }}$ext ./cmd/tc
57 changes: 54 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,52 @@ jobs:
path: agent/agent-${{ matrix.goos }}-${{ matrix.goarch }}
retention-days: 1

cli:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: windows
goarch: amd64

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: cli/go.mod
cache-dependency-path: cli/go.sum

- name: Build
working-directory: cli
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o tc-${{ matrix.goos }}-${{ matrix.goarch }}$ext ./cmd/tc

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: tc-${{ matrix.goos }}-${{ matrix.goarch }}
path: cli/tc-${{ matrix.goos }}-${{ matrix.goarch }}*
retention-days: 1

release:
needs: [agent, web, registry, updater]
needs: [agent, cli, web, registry, updater]
runs-on: ubuntu-latest
steps:
- name: Download agent artifacts
Expand All @@ -57,10 +101,17 @@ jobs:
pattern: agent-*
merge-multiple: true

- name: Download CLI artifacts
uses: actions/download-artifact@v8
with:
path: binaries
pattern: tc-*
merge-multiple: true

- name: Generate SHA256 checksums
run: |
cd binaries
sha256sum agent-* > checksums.txt
sha256sum agent-* tc-* > checksums.txt

- name: Create GitHub release
env:
Expand All @@ -70,7 +121,7 @@ jobs:
--repo ${{ github.repository }} \
--title "${{ github.ref_name }}" \
--generate-notes \
binaries/agent-* binaries/checksums.txt
binaries/agent-* binaries/tc-* binaries/checksums.txt

web:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion cli/.mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
bun = "latest"
go = "1.25.5"
91 changes: 0 additions & 91 deletions cli/bun.lock

This file was deleted.

17 changes: 17 additions & 0 deletions cli/cmd/tc/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"fmt"
"os"

"techulus/cloud-cli/internal/cli"
)

var version = "dev"

func main() {
if err := cli.Execute(version, os.Stdin, os.Stdout, os.Stderr); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
13 changes: 13 additions & 0 deletions cli/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module techulus/cloud-cli

go 1.25.5

require (
github.com/spf13/cobra v1.10.1
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.9 // indirect
)
12 changes: 12 additions & 0 deletions cli/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading
Loading