Files
bpmforge e0d82a4ed0 Kryptkeeper 1.0.0
First stable release. Notes: docs/release/RELEASE_NOTES_v1.0.0.md
Lab record: docs/release/LIVE_RESULTS_v1.0.0.md
2026-10-19 14:43:23 -04:00

117 lines
3.9 KiB
YAML

name: Agent Cross-Compile
on:
push:
tags:
- 'v*'
branches:
- main
- improve/**
pull_request:
paths:
- 'cmd/kryptkeeper-agent/**'
- 'internal/agentclient/**'
- 'internal/agentdiscovery/**'
# Least privilege (IAC-007): read-only by default; jobs that need more elevate
# it themselves.
permissions:
contents: read
jobs:
# W20-01: tag pushes always build (release); ordinary branch pushes only
# build when agent-related paths actually changed, so main churn unrelated
# to the agent doesn't spend Actions minutes on this workflow.
changes:
name: Detect relevant changes
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_type != 'tag'
outputs:
agent: ${{ steps.filter.outputs.agent }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3.0.4
id: filter
with:
filters: |
agent:
- 'cmd/kryptkeeper-agent/**'
- 'internal/agentclient/**'
- 'internal/agentdiscovery/**'
build:
name: Build agent binaries
runs-on: ubuntu-latest
needs: [changes]
if: |
always() &&
(github.event_name != 'push' || github.ref_type == 'tag' || needs.changes.outputs.agent == 'true')
strategy:
matrix:
# Linux agents are pure Go (no cgo deps), built static so one binary
# runs on any glibc/musl host and cross-builds from either runner arch.
include:
- goos: linux
goarch: amd64
suffix: linux-amd64
cgo_enabled: "0"
- goos: linux
goarch: arm64
suffix: linux-arm64
cgo_enabled: "0"
- goos: darwin
goarch: amd64
suffix: darwin-amd64
- goos: darwin
goarch: arm64
suffix: darwin-arm64
- goos: windows
goarch: amd64
suffix: windows-amd64.exe
cgo_enabled: "0"
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: go.mod
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
cache: false
- name: Build agent (${{ matrix.suffix }})
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: ${{ matrix.cgo_enabled || '1' }}
run: |
mkdir -p dist
go build -ldflags="-X main.version=${{ github.ref_name }}" \
-o dist/kryptkeeper-agent-${{ matrix.suffix }} \
./cmd/kryptkeeper-agent/
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kryptkeeper-agent-${{ matrix.suffix }}
path: dist/kryptkeeper-agent-${{ matrix.suffix }}
if-no-files-found: error
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: go.mod
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
cache: false
- name: Run tests
# Agent packages only: ci-pr/ci-main already run the whole module, and
# internal/bootstrap alone exceeds go test's 10m default on a busy runner.
run: go test -timeout 15m ./cmd/kryptkeeper-agent/... ./internal/agentclient/... ./internal/agentdiscovery/... ./internal/agentinstall/...