Add GitHub Actions CI and GoReleaser release
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / build (pull_request) Has been cancelled
ci / image (pull_request) Has been cancelled

This commit is contained in:
2026-11-20 22:11:39 +11:00
parent 29b3b1c6ba
commit 1f0d58e687
11 changed files with 199 additions and 200 deletions
-34
View File
@@ -1,34 +0,0 @@
#!/usr/bin/env bash
#
# Package the (already built) encapi-cli binary into an RPM with nfpm.
# Usage: scripts/build-rpm.sh [version] (version defaults to $CI_COMMIT_TAG)
#
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${ROOT_DIR}"
VERSION="${1:-${CI_COMMIT_TAG:-0.0.0-dev}}"
VERSION="${VERSION#v}" # strip a leading v
DIST="dist"
if [ ! -f "${DIST}/encapi-cli" ]; then
echo "ERROR: ${DIST}/encapi-cli not found; run 'make build-cli' first" >&2
exit 1
fi
export PACKAGE_NAME="encapi-cli"
export PACKAGE_VERSION="${VERSION}"
export PACKAGE_RELEASE="1"
export PACKAGE_ARCH="amd64"
export PACKAGE_PLATFORM="linux"
export PACKAGE_DESCRIPTION="CLI + Puppet ENC entrypoint for encapi (External Node Classifier)"
export PACKAGE_MAINTAINER="Ben Vincent <ben@unkin.net>"
export PACKAGE_HOMEPAGE="https://git.unkin.net/unkin/encapi"
export PACKAGE_LICENSE="MIT"
envsubst < packaging/nfpm.yaml > "${DIST}/nfpm.yaml"
nfpm pkg --config "${DIST}/nfpm.yaml" --target "${DIST}" --packager rpm
echo "Built:"
ls -1 "${DIST}"/*.rpm
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Detached binary signature of $1 into $2 via the Vault gpg engine.
set -euo pipefail
b=$(base64 -w0 "$1")
jq -n --arg input "$b" '{input: $input, format: "base64"}' \
| curl -sSf --cacert "${VAULT_CACERT:-/etc/vault-ca/ca.crt}" \
-H "X-Vault-Token: ${VAULT_TOKEN}" -d @- \
"${VAULT_ADDR}/v1/gpg/sign/iuclabs-release" \
| jq -er .data.signature | base64 -d > "$2"