Move CI scripts scripts/ -> ci/ (scripts/ è in gitignore)
Nightly Build / build (push) Failing after 6m4s
Nightly Build / build (push) Failing after 6m4s
This commit is contained in:
@@ -32,7 +32,7 @@ jobs:
|
|||||||
- name: Package amd64
|
- name: Package amd64
|
||||||
run: |
|
run: |
|
||||||
cd "${GITHUB_WORKSPACE:-.}"
|
cd "${GITHUB_WORKSPACE:-.}"
|
||||||
./scripts/package.sh \
|
./ci/package.sh \
|
||||||
--version nightly \
|
--version nightly \
|
||||||
--arch amd64 \
|
--arch amd64 \
|
||||||
--target-dir /home/dguiducci/.cache/skald-ci/target/release \
|
--target-dir /home/dguiducci/.cache/skald-ci/target/release \
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
- name: Package arm64
|
- name: Package arm64
|
||||||
run: |
|
run: |
|
||||||
cd "${GITHUB_WORKSPACE:-.}"
|
cd "${GITHUB_WORKSPACE:-.}"
|
||||||
./scripts/package.sh \
|
./ci/package.sh \
|
||||||
--version nightly \
|
--version nightly \
|
||||||
--arch arm64 \
|
--arch arm64 \
|
||||||
--target-dir /home/dguiducci/.cache/skald-ci/target/aarch64-unknown-linux-gnu/release \
|
--target-dir /home/dguiducci/.cache/skald-ci/target/aarch64-unknown-linux-gnu/release \
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Verify version is new
|
- name: Verify version is new
|
||||||
run: ./scripts/verify-version.sh --builds-dir /var/www/builds.skaldagent.net
|
run: ./ci/verify-version.sh --builds-dir /var/www/builds.skaldagent.net
|
||||||
|
|
||||||
# ── Push/merge: build, package, and deploy the release ──────────────────────
|
# ── Push/merge: build, package, and deploy the release ──────────────────────
|
||||||
release:
|
release:
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
# Also run verify-version on push to catch any race (belt-and-suspenders)
|
# Also run verify-version on push to catch any race (belt-and-suspenders)
|
||||||
- name: Verify version is new
|
- name: Verify version is new
|
||||||
run: ./scripts/verify-version.sh --builds-dir /var/www/builds.skaldagent.net
|
run: ./ci/verify-version.sh --builds-dir /var/www/builds.skaldagent.net
|
||||||
|
|
||||||
- name: Build native (linux/amd64)
|
- name: Build native (linux/amd64)
|
||||||
run: |
|
run: |
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
- name: Package amd64
|
- name: Package amd64
|
||||||
run: |
|
run: |
|
||||||
cd "${GITHUB_WORKSPACE:-.}"
|
cd "${GITHUB_WORKSPACE:-.}"
|
||||||
./scripts/package.sh \
|
./ci/package.sh \
|
||||||
--version "${{ steps.extract-version.outputs.version }}" \
|
--version "${{ steps.extract-version.outputs.version }}" \
|
||||||
--arch amd64 \
|
--arch amd64 \
|
||||||
--target-dir /home/dguiducci/.cache/skald-ci/target/release \
|
--target-dir /home/dguiducci/.cache/skald-ci/target/release \
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
- name: Package arm64
|
- name: Package arm64
|
||||||
run: |
|
run: |
|
||||||
cd "${GITHUB_WORKSPACE:-.}"
|
cd "${GITHUB_WORKSPACE:-.}"
|
||||||
./scripts/package.sh \
|
./ci/package.sh \
|
||||||
--version "${{ steps.extract-version.outputs.version }}" \
|
--version "${{ steps.extract-version.outputs.version }}" \
|
||||||
--arch arm64 \
|
--arch arm64 \
|
||||||
--target-dir /home/dguiducci/.cache/skald-ci/target/aarch64-unknown-linux-gnu/release \
|
--target-dir /home/dguiducci/.cache/skald-ci/target/aarch64-unknown-linux-gnu/release \
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ blueprint/
|
|||||||
/logs/
|
/logs/
|
||||||
/tmp/
|
/tmp/
|
||||||
/scripts/
|
/scripts/
|
||||||
!scripts/package.sh
|
|
||||||
!scripts/verify-version.sh
|
|
||||||
# Connector folders installed from the marketplace — instance data, like homes/
|
# Connector folders installed from the marketplace — instance data, like homes/
|
||||||
# and database/, not source. See crates/skald-core/src/mcp/install.rs
|
# and database/, not source. See crates/skald-core/src/mcp/install.rs
|
||||||
/connectors/
|
/connectors/
|
||||||
|
|||||||
Executable
+92
@@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
# Package a Skald Circle build into a distributable tarball.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./scripts/package.sh \
|
||||||
|
# --version v0.1.0 \
|
||||||
|
# --arch amd64 \
|
||||||
|
# --target-dir target/release \
|
||||||
|
# --output /tmp/dist
|
||||||
|
#
|
||||||
|
# --version Version string, e.g. "v0.1.0" or "nightly"
|
||||||
|
# --arch Architecture: "amd64" or "arm64"
|
||||||
|
# --target-dir Path to cargo release output (target/release or
|
||||||
|
# target/aarch64-unknown-linux-gnu/release)
|
||||||
|
# --output Directory where the .tar.gz will be written
|
||||||
|
#
|
||||||
|
# The tarball contains everything needed to run Skald Circle:
|
||||||
|
# bin/skald, bin/skald-setup, web/, agents/, skills/,
|
||||||
|
# default.config.yaml, requirements.txt, run.sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
# ── Parse args ────────────────────────────────────────────────────────────────
|
||||||
|
VERSION=""
|
||||||
|
ARCH=""
|
||||||
|
TARGET_DIR=""
|
||||||
|
OUTPUT=""
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--version) VERSION="$2"; shift 2 ;;
|
||||||
|
--arch) ARCH="$2"; shift 2 ;;
|
||||||
|
--target-dir) TARGET_DIR="$2"; shift 2 ;;
|
||||||
|
--output) OUTPUT="$2"; shift 2 ;;
|
||||||
|
*) echo "[package.sh] Unknown option: $1" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ] || [ -z "$ARCH" ] || [ -z "$TARGET_DIR" ] || [ -z "$OUTPUT" ]; then
|
||||||
|
echo "[package.sh] Missing required argument. See usage." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PACKAGE_NAME="skald-circle-${VERSION}-linux-${ARCH}"
|
||||||
|
STAGING="$(mktemp -d)/${PACKAGE_NAME}"
|
||||||
|
mkdir -p "$STAGING/bin"
|
||||||
|
|
||||||
|
echo "[package.sh] Packaging $PACKAGE_NAME"
|
||||||
|
echo "[package.sh] target-dir: $TARGET_DIR"
|
||||||
|
echo "[package.sh] output: $OUTPUT"
|
||||||
|
|
||||||
|
# ── Verify binaries exist ─────────────────────────────────────────────────────
|
||||||
|
if [ ! -f "$TARGET_DIR/skald" ]; then
|
||||||
|
echo "[package.sh] ERROR: skald binary not found at $TARGET_DIR/skald" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -f "$TARGET_DIR/skald-setup" ]; then
|
||||||
|
echo "[package.sh] ERROR: skald-setup binary not found at $TARGET_DIR/skald-setup" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Copy binaries (stripped) ──────────────────────────────────────────────────
|
||||||
|
cp "$TARGET_DIR/skald" "$STAGING/bin/skald"
|
||||||
|
cp "$TARGET_DIR/skald-setup" "$STAGING/bin/skald-setup"
|
||||||
|
strip "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
|
||||||
|
chmod 755 "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
|
||||||
|
|
||||||
|
# ── Copy runtime assets ───────────────────────────────────────────────────────
|
||||||
|
cp -r web "$STAGING/web"
|
||||||
|
cp -r agents "$STAGING/agents"
|
||||||
|
cp -r skills "$STAGING/skills"
|
||||||
|
cp default.config.yaml "$STAGING/default.config.yaml"
|
||||||
|
cp requirements.txt "$STAGING/requirements.txt"
|
||||||
|
cp run.sh "$STAGING/run.sh"
|
||||||
|
chmod 755 "$STAGING/run.sh"
|
||||||
|
|
||||||
|
# ── Create tarball ────────────────────────────────────────────────────────────
|
||||||
|
mkdir -p "$OUTPUT"
|
||||||
|
TARBALL="${OUTPUT}/${PACKAGE_NAME}.tar.gz"
|
||||||
|
|
||||||
|
cd "$(dirname "$STAGING")"
|
||||||
|
tar czf "$TARBALL" "$PACKAGE_NAME"
|
||||||
|
cd - > /dev/null
|
||||||
|
|
||||||
|
rm -rf "$(dirname "$STAGING")"
|
||||||
|
|
||||||
|
SHA256="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
|
||||||
|
echo "[package.sh] ✅ Created $TARBALL"
|
||||||
|
echo "[package.sh] sha256: $SHA256"
|
||||||
|
echo "[package.sh] size: $(du -h "$TARBALL" | cut -f1)"
|
||||||
Executable
+56
@@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
# Verify that a Skald Circle release version has not been built yet.
|
||||||
|
#
|
||||||
|
# Intended as a required Gitea Actions status check on PRs to the `release`
|
||||||
|
# branch. Runs in the repo root after checkout.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./scripts/verify-version.sh \
|
||||||
|
# --builds-dir /var/www/builds.skaldagent.net
|
||||||
|
#
|
||||||
|
# Exit codes:
|
||||||
|
# 0 → version is new (or builds-dir doesn't exist yet) → PR may proceed
|
||||||
|
# 1 → version already built → PR should fail
|
||||||
|
#
|
||||||
|
# Reads the version from Cargo.toml in the current directory.
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# ── Parse args ────────────────────────────────────────────────────────────────
|
||||||
|
BUILDS_DIR=""
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--builds-dir) BUILDS_DIR="$2"; shift 2 ;;
|
||||||
|
*) echo "[verify-version] Unknown option: $1" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$BUILDS_DIR" ]; then
|
||||||
|
echo "[verify-version] Missing --builds-dir" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Read version from Cargo.toml ──────────────────────────────────────────────
|
||||||
|
# This is the workspace root's Cargo.toml.
|
||||||
|
VERSION="$(grep '^version ' Cargo.toml | head -1 | sed 's/version *= *"\(.*\)"/\1/')"
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "[verify-version] ERROR: Could not read version from Cargo.toml" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[verify-version] Version in Cargo.toml: v${VERSION}"
|
||||||
|
|
||||||
|
# ── Check if already built ────────────────────────────────────────────────────
|
||||||
|
RELEASE_DIR="${BUILDS_DIR}/releases/v${VERSION}"
|
||||||
|
|
||||||
|
if [ -d "$RELEASE_DIR" ]; then
|
||||||
|
echo "[verify-version] ❌ Release v${VERSION} already exists at:"
|
||||||
|
echo "[verify-version] ${RELEASE_DIR}"
|
||||||
|
echo "[verify-version] Bump the version in Cargo.toml before merging."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[verify-version] ✅ Release v${VERSION} is new — no conflict."
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user