mirror of
https://github.com/yusing/godoxy.git
synced 2026-02-24 03:14:50 +01:00
feat(cli): add CLI application with automatic command generation from swagger
Add a new CLI application (`cmd/cli/`) that generates command-line interface commands from the API swagger specification. Includes: - Main CLI entry point with command parsing and execution - Code generator that reads swagger.json and generates typed command handlers - Makefile targets (`gen-cli`, `build-cli`) for generating and building the CLI - GitHub Actions workflow to build cross-platform CLI binaries (linux/amd64, linux/arm64)
This commit is contained in:
60
.github/workflows/cli-binary.yml
vendored
Executable file
60
.github/workflows/cli-binary.yml
vendored
Executable file
@@ -0,0 +1,60 @@
|
||||
name: GoDoxy CLI Binary
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "cmd/cli/**"
|
||||
- "internal/api/v1/docs/swagger.json"
|
||||
- "Makefile"
|
||||
- ".github/workflows/cli-binary.yml"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "cmd/cli/**"
|
||||
- "internal/api/v1/docs/swagger.json"
|
||||
- "Makefile"
|
||||
- ".github/workflows/cli-binary.yml"
|
||||
tags-ignore:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-latest
|
||||
platform: linux/amd64
|
||||
binary_name: godoxy-cli-linux-amd64
|
||||
- runner: ubuntu-24.04-arm
|
||||
platform: linux/arm64
|
||||
binary_name: godoxy-cli-linux-arm64
|
||||
name: Build ${{ matrix.platform }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Verify dependencies
|
||||
run: go mod verify
|
||||
|
||||
- name: Build CLI
|
||||
run: |
|
||||
make CLI_BIN_PATH=bin/${{ matrix.binary_name }} build-cli
|
||||
|
||||
- name: Check binary
|
||||
run: |
|
||||
file bin/${{ matrix.binary_name }}
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.binary_name }}
|
||||
path: bin/${{ matrix.binary_name }}
|
||||
Reference in New Issue
Block a user