mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-07 17:31:30 +00:00
bcf2c3ae92
Pre-2.1.0 adoption polish delivering all four milestones: A) Demo Data Overhaul — seed_demo.sql rewritten with 35 certs across 5 issuers, 8 agents, 8 targets, 50+ jobs spanning 90 days, 55+ audit events, discovery scans, network scan targets, S/MIME cert. B) Examples Directory — 5 turnkey docker-compose configs: acme-nginx, acme-wildcard-dns01, private-ca-traefik, step-ca-haproxy, multi-issuer. C) Migration Guides — migrate-from-certbot.md, migrate-from-acmesh.md, certctl-for-cert-manager-users.md. D) Agent Install Script — install-agent.sh with cross-platform support (Linux systemd + macOS launchd), release.yml updated for 6-target cross-compilation. Triple-audited against codebase: 22 factual corrections applied across docs, examples, and config (env var names, CLI flags, ports, DNS hook interface, scheduler loop counts, license conversion date). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
212 lines
6.0 KiB
YAML
212 lines
6.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
GO_VERSION: '1.22'
|
|
|
|
jobs:
|
|
# Cross-compile agent and server binaries for multiple platforms
|
|
build-binaries:
|
|
name: Build Cross-Platform Binaries
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# Agent binaries (4 platforms)
|
|
- os: linux
|
|
arch: amd64
|
|
binary: agent
|
|
- os: linux
|
|
arch: arm64
|
|
binary: agent
|
|
- os: darwin
|
|
arch: amd64
|
|
binary: agent
|
|
- os: darwin
|
|
arch: arm64
|
|
binary: agent
|
|
# Server binaries (2 platforms)
|
|
- os: linux
|
|
arch: amd64
|
|
binary: server
|
|
- os: linux
|
|
arch: arm64
|
|
binary: server
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build ${{ matrix.binary }} binary (${{ matrix.os }}-${{ matrix.arch }})
|
|
env:
|
|
GOOS: ${{ matrix.os }}
|
|
GOARCH: ${{ matrix.arch }}
|
|
CGO_ENABLED: 0
|
|
run: |
|
|
OUTPUT_NAME="certctl-${{ matrix.binary }}-${{ matrix.os }}-${{ matrix.arch }}"
|
|
go build -ldflags="-w -s -X main.Version=${{ steps.version.outputs.VERSION }}" \
|
|
-o "dist/${OUTPUT_NAME}" \
|
|
"./cmd/${{ matrix.binary }}"
|
|
ls -lh "dist/${OUTPUT_NAME}"
|
|
|
|
- name: Upload binaries to release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
dist/certctl-agent-*
|
|
dist/certctl-server-*
|
|
|
|
# Build and push Docker images
|
|
build-and-push-docker:
|
|
name: Build & Push Docker Images
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push server image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/shankar0123/certctl-server:${{ steps.version.outputs.VERSION }}
|
|
${{ env.REGISTRY }}/shankar0123/certctl-server:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Build and push agent image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.agent
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/shankar0123/certctl-agent:${{ steps.version.outputs.VERSION }}
|
|
${{ env.REGISTRY }}/shankar0123/certctl-agent:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
# Create release notes with all artifacts
|
|
create-release:
|
|
name: Create Release Notes
|
|
runs-on: ubuntu-latest
|
|
needs: [build-binaries, build-and-push-docker]
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create release with notes
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
body: |
|
|
## Installation
|
|
|
|
### Quick Install (Linux/macOS)
|
|
|
|
```bash
|
|
curl -sSL https://raw.githubusercontent.com/shankar0123/certctl/master/install-agent.sh | bash
|
|
```
|
|
|
|
### Manual Binary Download
|
|
|
|
Download the appropriate binary for your OS and architecture:
|
|
|
|
- **Linux x86_64**: `certctl-agent-linux-amd64`
|
|
- **Linux ARM64**: `certctl-agent-linux-arm64`
|
|
- **macOS x86_64**: `certctl-agent-darwin-amd64`
|
|
- **macOS ARM64 (Apple Silicon)**: `certctl-agent-darwin-arm64`
|
|
|
|
Then make it executable and start the service:
|
|
|
|
```bash
|
|
chmod +x certctl-agent-linux-amd64
|
|
sudo mv certctl-agent-linux-amd64 /usr/local/bin/certctl-agent
|
|
```
|
|
|
|
## Docker Images
|
|
|
|
Pull pre-built Docker images for server and agent:
|
|
|
|
```bash
|
|
docker pull ghcr.io/shankar0123/certctl-server:${{ steps.version.outputs.VERSION }}
|
|
docker pull ghcr.io/shankar0123/certctl-agent:${{ steps.version.outputs.VERSION }}
|
|
```
|
|
|
|
Or use the latest tag:
|
|
|
|
```bash
|
|
docker pull ghcr.io/shankar0123/certctl-server:latest
|
|
docker pull ghcr.io/shankar0123/certctl-agent:latest
|
|
```
|
|
|
|
## Docker Compose Quick Start
|
|
|
|
```bash
|
|
git clone https://github.com/shankar0123/certctl.git
|
|
cd certctl
|
|
cp deploy/.env.example deploy/.env
|
|
docker compose -f deploy/docker-compose.yml up -d
|
|
```
|
|
|
|
## Server Binaries
|
|
|
|
Pre-compiled server binaries are also available for direct installation:
|
|
|
|
- **Linux x86_64**: `certctl-server-linux-amd64`
|
|
- **Linux ARM64**: `certctl-server-linux-arm64`
|
|
|
|
## Helm Chart
|
|
|
|
Deploy certctl to Kubernetes using Helm:
|
|
|
|
```bash
|
|
helm repo add certctl https://github.com/shankar0123/certctl/tree/master/deploy/helm
|
|
helm repo update
|
|
helm install certctl certctl/certctl
|
|
```
|
|
|
|
See `deploy/helm/certctl/` for values customization.
|