fix: correct arch naming and build order for ARM64 packages
Some checks are pending
CI/CD / lint (push) Successful in 50s
CI/CD / test (push) Successful in 1m4s
CI/CD / typecheck (push) Successful in 3m0s
CI/CD / build (amd64) (push) Successful in 2m22s
CI/CD / build (arm64) (push) Successful in 1m45s
CI/CD / publish-rpm (amd64) (push) Successful in 46s
CI/CD / publish-rpm (arm64) (push) Successful in 48s
CI/CD / publish-deb (amd64) (push) Successful in 58s
CI/CD / publish-deb (arm64) (push) Successful in 58s
CI/CD / smoke (push) Has started running
Some checks are pending
CI/CD / lint (push) Successful in 50s
CI/CD / test (push) Successful in 1m4s
CI/CD / typecheck (push) Successful in 3m0s
CI/CD / build (amd64) (push) Successful in 2m22s
CI/CD / build (arm64) (push) Successful in 1m45s
CI/CD / publish-rpm (amd64) (push) Successful in 46s
CI/CD / publish-rpm (arm64) (push) Successful in 48s
CI/CD / publish-deb (amd64) (push) Successful in 58s
CI/CD / publish-deb (arm64) (push) Successful in 58s
CI/CD / smoke (push) Has started running
- nfpm.yaml: use ${NFPM_ARCH} (Go's ExpandEnv doesn't support :-default)
- arch-helper.sh: export RPM_ARCH (x86_64/aarch64) alongside NFPM_ARCH
- build-rpm/deb.sh: build TypeScript before running tests (tests need
built @mcpctl/shared), generate Prisma client on fresh checkout
- Fix RPM filename matching to use aarch64 not arm64
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,10 +29,10 @@ fi
|
|||||||
echo "==> Detected package format: $PKG_FORMAT (arch: $NFPM_ARCH)"
|
echo "==> Detected package format: $PKG_FORMAT (arch: $NFPM_ARCH)"
|
||||||
|
|
||||||
# Find package matching the target architecture
|
# Find package matching the target architecture
|
||||||
|
# RPM uses x86_64/aarch64, DEB uses amd64/arm64
|
||||||
find_pkg() {
|
find_pkg() {
|
||||||
local pattern="$1"
|
local pattern="$1"
|
||||||
# Filter by architecture name in filename
|
ls $pattern 2>/dev/null | grep -E "[._](${NFPM_ARCH}|${RPM_ARCH})[._]" | head -1
|
||||||
ls $pattern 2>/dev/null | grep -E "[._]${NFPM_ARCH}[._]" | head -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$PKG_FORMAT" = "rpm" ]; then
|
if [ "$PKG_FORMAT" = "rpm" ]; then
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: mcpctl
|
name: mcpctl
|
||||||
arch: ${NFPM_ARCH:-amd64}
|
arch: ${NFPM_ARCH}
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
release: "1"
|
release: "1"
|
||||||
maintainer: michal
|
maintainer: michal
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# Source this file, then call: resolve_arch [target_arch]
|
# Source this file, then call: resolve_arch [target_arch]
|
||||||
#
|
#
|
||||||
# Outputs (exported):
|
# Outputs (exported):
|
||||||
# NFPM_ARCH — nfpm/deb/rpm arch name: "amd64" or "arm64"
|
# NFPM_ARCH — nfpm arch name: "amd64" or "arm64"
|
||||||
|
# RPM_ARCH — RPM arch name: "x86_64" or "aarch64"
|
||||||
# BUN_TARGET — bun cross-compile target (empty if native build)
|
# BUN_TARGET — bun cross-compile target (empty if native build)
|
||||||
# ARCH_SUFFIX — filename suffix for cross-compiled binaries (empty if native)
|
# ARCH_SUFFIX — filename suffix for cross-compiled binaries (empty if native)
|
||||||
|
|
||||||
@@ -57,6 +58,13 @@ resolve_arch() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export NFPM_ARCH BUN_TARGET ARCH_SUFFIX
|
# RPM uses different arch names than deb/nfpm
|
||||||
|
case "$NFPM_ARCH" in
|
||||||
|
amd64) RPM_ARCH="x86_64" ;;
|
||||||
|
arm64) RPM_ARCH="aarch64" ;;
|
||||||
|
*) RPM_ARCH="$NFPM_ARCH" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
export NFPM_ARCH RPM_ARCH BUN_TARGET ARCH_SUFFIX
|
||||||
echo " Architecture: ${NFPM_ARCH} (native: ${native}${BUN_TARGET:+, cross-compiling via $BUN_TARGET})"
|
echo " Architecture: ${NFPM_ARCH} (native: ${native}${BUN_TARGET:+, cross-compiling via $BUN_TARGET})"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,13 +28,19 @@ if [ ! -f "dist/mcpctl${ARCH_SUFFIX}" ] || [ ! -f "dist/mcpctl-local${ARCH_SUFFI
|
|||||||
echo "==> Binaries not found, building from scratch..."
|
echo "==> Binaries not found, building from scratch..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "==> Running unit tests..."
|
# Generate Prisma client if missing (fresh checkout)
|
||||||
pnpm test:run
|
if [ ! -d src/db/node_modules/.prisma ]; then
|
||||||
echo ""
|
echo "==> Generating Prisma client..."
|
||||||
|
pnpm --filter @mcpctl/db exec prisma generate
|
||||||
|
fi
|
||||||
|
|
||||||
echo "==> Building TypeScript..."
|
echo "==> Building TypeScript..."
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
|
echo "==> Running unit tests..."
|
||||||
|
pnpm test:run
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo "==> Generating shell completions..."
|
echo "==> Generating shell completions..."
|
||||||
pnpm completions:generate
|
pnpm completions:generate
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,19 @@ resolve_arch "${MCPCTL_TARGET_ARCH:-}"
|
|||||||
source "$SCRIPT_DIR/ensure-deps.sh"
|
source "$SCRIPT_DIR/ensure-deps.sh"
|
||||||
ensure_build_deps
|
ensure_build_deps
|
||||||
|
|
||||||
echo "==> Running unit tests..."
|
# Generate Prisma client if missing (fresh checkout)
|
||||||
pnpm test:run
|
if [ ! -d src/db/node_modules/.prisma ]; then
|
||||||
echo ""
|
echo "==> Generating Prisma client..."
|
||||||
|
pnpm --filter @mcpctl/db exec prisma generate
|
||||||
|
fi
|
||||||
|
|
||||||
echo "==> Building TypeScript..."
|
echo "==> Building TypeScript..."
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
|
echo "==> Running unit tests..."
|
||||||
|
pnpm test:run
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo "==> Generating shell completions..."
|
echo "==> Generating shell completions..."
|
||||||
pnpm completions:generate
|
pnpm completions:generate
|
||||||
|
|
||||||
@@ -37,7 +43,7 @@ echo "==> Bundling standalone binaries (target: ${NFPM_ARCH})..."
|
|||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
rm -f "dist/mcpctl${ARCH_SUFFIX}" "dist/mcpctl-local${ARCH_SUFFIX}"
|
rm -f "dist/mcpctl${ARCH_SUFFIX}" "dist/mcpctl-local${ARCH_SUFFIX}"
|
||||||
# Only remove RPMs for the target arch (preserve cross-compiled packages)
|
# Only remove RPMs for the target arch (preserve cross-compiled packages)
|
||||||
ls dist/mcpctl-*.${NFPM_ARCH}.rpm 2>/dev/null | xargs -r rm -f
|
ls dist/mcpctl-*.${RPM_ARCH}.rpm 2>/dev/null | xargs -r rm -f
|
||||||
|
|
||||||
# Ink optionally imports react-devtools-core which isn't installed.
|
# Ink optionally imports react-devtools-core which isn't installed.
|
||||||
# Provide a no-op stub so bun can bundle it (it's only invoked when DEV=true).
|
# Provide a no-op stub so bun can bundle it (it's only invoked when DEV=true).
|
||||||
@@ -58,7 +64,7 @@ echo "==> Packaging RPM (arch: ${NFPM_ARCH})..."
|
|||||||
export NFPM_ARCH
|
export NFPM_ARCH
|
||||||
nfpm pkg --packager rpm --target dist/
|
nfpm pkg --packager rpm --target dist/
|
||||||
|
|
||||||
RPM_FILE=$(ls dist/mcpctl-*.${NFPM_ARCH}.rpm 2>/dev/null | head -1)
|
RPM_FILE=$(ls dist/mcpctl-*.${RPM_ARCH}.rpm 2>/dev/null | head -1)
|
||||||
echo "==> Built: $RPM_FILE"
|
echo "==> Built: $RPM_FILE"
|
||||||
echo " Size: $(du -h "$RPM_FILE" | cut -f1)"
|
echo " Size: $(du -h "$RPM_FILE" | cut -f1)"
|
||||||
if command -v rpm &>/dev/null; then
|
if command -v rpm &>/dev/null; then
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ fi
|
|||||||
source "$SCRIPT_DIR/arch-helper.sh"
|
source "$SCRIPT_DIR/arch-helper.sh"
|
||||||
resolve_arch "${MCPCTL_TARGET_ARCH:-}"
|
resolve_arch "${MCPCTL_TARGET_ARCH:-}"
|
||||||
|
|
||||||
# Find RPM matching target architecture
|
# Find RPM matching target architecture (RPM uses x86_64/aarch64)
|
||||||
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | grep -E "[._]${NFPM_ARCH}[._]" | head -1)
|
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | grep -E "[._]${RPM_ARCH}[._]" | head -1)
|
||||||
if [ -z "$RPM_FILE" ]; then
|
if [ -z "$RPM_FILE" ]; then
|
||||||
# Fallback: try any rpm file
|
# Fallback: try any rpm file
|
||||||
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | head -1)
|
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | head -1)
|
||||||
|
|||||||
@@ -53,7 +53,10 @@ if command -v dpkg &>/dev/null && ! command -v dnf &>/dev/null; then
|
|||||||
DEB_FILE=$(ls dist/mcpctl*.deb 2>/dev/null | grep -E "[._]${NATIVE_ARCH}[._]" | head -1)
|
DEB_FILE=$(ls dist/mcpctl*.deb 2>/dev/null | grep -E "[._]${NATIVE_ARCH}[._]" | head -1)
|
||||||
sudo dpkg -i "$DEB_FILE" || sudo apt-get install -f -y
|
sudo dpkg -i "$DEB_FILE" || sudo apt-get install -f -y
|
||||||
else
|
else
|
||||||
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | grep -E "[._]${NATIVE_ARCH}[._]" | head -1)
|
# RPM filenames use x86_64/aarch64, not amd64/arm64
|
||||||
|
local rpm_arch
|
||||||
|
case "$NATIVE_ARCH" in amd64) rpm_arch="x86_64" ;; arm64) rpm_arch="aarch64" ;; *) rpm_arch="$NATIVE_ARCH" ;; esac
|
||||||
|
RPM_FILE=$(ls dist/mcpctl-*.rpm 2>/dev/null | grep -E "[._]${rpm_arch}[._]" | head -1)
|
||||||
sudo rpm -U --force "$RPM_FILE"
|
sudo rpm -U --force "$RPM_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user