mirror of
https://github.com/harivansh-afk/agentikube.git
synced 2026-04-15 07:04:44 +00:00
build
This commit is contained in:
parent
011170671c
commit
6d7716a0fe
3 changed files with 155 additions and 1 deletions
27
.github/workflows/ci.yml
vendored
Normal file
27
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- main
|
||||||
|
tags-ignore:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build ./...
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test ./...
|
||||||
95
.github/workflows/release.yml
vendored
Normal file
95
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags-ignore:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
if: github.actor != 'github-actions[bot]'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
|
||||||
|
- name: Compute next version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
latest_tag="$(git tag --list 'v*' --sort=-v:refname | head -n 1)"
|
||||||
|
if [ -z "$latest_tag" ]; then
|
||||||
|
next_tag="v0.1.0"
|
||||||
|
else
|
||||||
|
base="${latest_tag#v}"
|
||||||
|
IFS='.' read -r major minor patch <<< "$base"
|
||||||
|
patch=$((patch + 1))
|
||||||
|
next_tag="v${major}.${minor}.${patch}"
|
||||||
|
fi
|
||||||
|
echo "next_tag=$next_tag" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "version=${next_tag#v}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Commit VERSION
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "${{ steps.version.outputs.version }}" > VERSION
|
||||||
|
if git diff --quiet VERSION; then
|
||||||
|
echo "VERSION unchanged"
|
||||||
|
else
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add VERSION
|
||||||
|
git commit -m "chore(release): ${{ steps.version.outputs.next_tag }} [skip ci]"
|
||||||
|
git push origin HEAD:main
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
git fetch --tags
|
||||||
|
if git rev-parse "${{ steps.version.outputs.next_tag }}" >/dev/null 2>&1; then
|
||||||
|
echo "Tag already exists: ${{ steps.version.outputs.next_tag }}"
|
||||||
|
else
|
||||||
|
git tag "${{ steps.version.outputs.next_tag }}"
|
||||||
|
git push origin "${{ steps.version.outputs.next_tag }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build release binaries
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
mkdir -p dist
|
||||||
|
version="${{ steps.version.outputs.next_tag }}"
|
||||||
|
|
||||||
|
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${version}" -o "dist/agentikube_${version}_linux_amd64" ./cmd/agentikube
|
||||||
|
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${version}" -o "dist/agentikube_${version}_linux_arm64" ./cmd/agentikube
|
||||||
|
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${version}" -o "dist/agentikube_${version}_darwin_amd64" ./cmd/agentikube
|
||||||
|
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=${version}" -o "dist/agentikube_${version}_darwin_arm64" ./cmd/agentikube
|
||||||
|
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${version}" -o "dist/agentikube_${version}_windows_amd64.exe" ./cmd/agentikube
|
||||||
|
|
||||||
|
- name: Create GitHub release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.version.outputs.next_tag }}
|
||||||
|
name: ${{ steps.version.outputs.next_tag }}
|
||||||
|
generate_release_notes: true
|
||||||
|
files: dist/*
|
||||||
34
README.md
34
README.md
|
|
@ -4,7 +4,9 @@
|
||||||
[](https://github.com/harivansh-afk/agentikube/releases)
|
[](https://github.com/harivansh-afk/agentikube/releases)
|
||||||
[](https://github.com/harivansh-afk/agentikube)
|
[](https://github.com/harivansh-afk/agentikube)
|
||||||
[](https://github.com/harivansh-afk/agentikube/blob/main/go.mod)
|
[](https://github.com/harivansh-afk/agentikube/blob/main/go.mod)
|
||||||
[](https://github.com/harivansh-afk/agentikube)
|
[](https://github.com/harivansh-afk/agentikube)
|
||||||
|
[](https://github.com/harivansh-afk/agentikube/actions/workflows/ci.yml)
|
||||||
|
[](https://github.com/harivansh-afk/agentikube/actions/workflows/release.yml)
|
||||||
|
|
||||||
This repo is a small Go CLI for running isolated agent sandboxes on Kubernetes.
|
This repo is a small Go CLI for running isolated agent sandboxes on Kubernetes.
|
||||||
|
|
||||||
|
|
@ -132,6 +134,36 @@ agentikube list
|
||||||
agentikube ssh demo
|
agentikube ssh demo
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Test CLI Locally
|
||||||
|
|
||||||
|
Use this exact flow to verify the CLI on your machine:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1) Build + tests
|
||||||
|
mkdir -p .cache/go-build .cache/go-mod
|
||||||
|
GOCACHE=$(pwd)/.cache/go-build GOMODCACHE=$(pwd)/.cache/go-mod go build ./...
|
||||||
|
GOCACHE=$(pwd)/.cache/go-build GOMODCACHE=$(pwd)/.cache/go-mod go test ./...
|
||||||
|
|
||||||
|
# 2) Root help + command help
|
||||||
|
GOCACHE=$(pwd)/.cache/go-build GOMODCACHE=$(pwd)/.cache/go-mod go run ./cmd/agentikube --help
|
||||||
|
for c in init up create list ssh down destroy status; do
|
||||||
|
GOCACHE=$(pwd)/.cache/go-build GOMODCACHE=$(pwd)/.cache/go-mod go run ./cmd/agentikube "$c" --help >/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
# 3) Manifest generation smoke test
|
||||||
|
./agentikube up --dry-run --config agentikube.example.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
If those pass, the CLI wiring + config + templating path is working locally.
|
||||||
|
|
||||||
|
## CI And Auto Release
|
||||||
|
|
||||||
|
This repo now has two GitHub Actions workflows:
|
||||||
|
- `.github/workflows/ci.yml`
|
||||||
|
Runs `go build ./...` and `go test ./...` on PRs and non-main branch pushes.
|
||||||
|
- `.github/workflows/release.yml`
|
||||||
|
Runs on push to `main`, auto-bumps patch version (`vX.Y.Z`), writes `VERSION`, creates/pushes tag, builds multi-platform binaries, and creates a GitHub Release with artifacts.
|
||||||
|
|
||||||
## Notes / Current Limits
|
## Notes / Current Limits
|
||||||
|
|
||||||
- `storage.type` currently must be `efs`.
|
- `storage.type` currently must be `efs`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue