From 421f3085f065795103f9baad6a3952914d2df1b9 Mon Sep 17 00:00:00 2001 From: EugeneTes Date: Thu, 23 Jul 2026 08:44:17 +0000 Subject: [PATCH] select insin CLI by host arch, drop qemu note, bump version to 1.0.15 --- CLAUDE.md | 6 +++--- EpsonPrintService/EpsonPrintService.csproj | 2 +- scripts/publish-insin.sh | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0bcfff5..598e933 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -317,9 +317,9 @@ Insin uses a flat global package namespace with the `AdminToken` auth header (NO set -euo pipefail : "${INSIN_URL:?}" "${INSIN_TOKEN:?}" -# 1. Fetch latest CLI (linux-arm64 shown; use win-x64 on Windows CI). +# 1. Fetch latest CLI (pick RID matching host — linux-x64 shown). LATEST=$(curl -fsSL "$INSIN_URL/api/v1/downloads/cli" \ - | python3 -c 'import json,sys; m=json.load(sys.stdin)[0]; a=next(x for x in m["artifacts"] if x["rid"]=="linux-arm64"); print(m["version"], a["filename"])') + | python3 -c 'import json,sys; m=json.load(sys.stdin)[0]; a=next(x for x in m["artifacts"] if x["rid"]=="linux-x64"); print(m["version"], a["filename"])') VERSION=${LATEST% *}; FILENAME=${LATEST#* } curl -fsSL "$INSIN_URL/api/v1/downloads/cli/$VERSION/$FILENAME" -o /tmp/insin.tar.gz mkdir -p /tmp/insin && tar -xzf /tmp/insin.tar.gz -C /tmp/insin @@ -345,7 +345,7 @@ Under the hood `publish` = `POST $INSIN_URL/api/v1/admin/packages` (multipart fo - **First publish auto-creates** the package name. No separate registration. - **Versions are immutable.** Re-publishing the same `(name, version)` returns **409 Conflict**. Bump the version. - **Flat global namespace** — no scopes. Pick a distinctive name (we use `epson-print-service`). -- **CLI artifacts:** only `linux-arm64` and `win-x64` today. On `linux-x64` CI, run under qemu (`--platform linux/arm64`) — the CLI is just packer + uploader so emulation is fine. +- **CLI artifacts** ship for `linux-x64`, `linux-arm64`, `linux-arm`, and `win-x64` (as of CLI 1.3.1). Pick the RID that matches the host; no qemu required. - **`insin pack` output is one dir UP** (`../packages/`), not `./`. Look there if the `.pkg` seems missing. - If both `INSIN_ADMIN_TOKEN` and `INSIN_TOKEN` are set, `publish` reads `INSIN_TOKEN` first (service token wins). - **List packages:** `curl -H "Authorization: AdminToken $INSIN_TOKEN" $INSIN_URL/api/v1/admin/packages`. diff --git a/EpsonPrintService/EpsonPrintService.csproj b/EpsonPrintService/EpsonPrintService.csproj index c490f69..87346a8 100644 --- a/EpsonPrintService/EpsonPrintService.csproj +++ b/EpsonPrintService/EpsonPrintService.csproj @@ -5,7 +5,7 @@ net8.0 enable enable - 1.0.14 + 1.0.15 diff --git a/scripts/publish-insin.sh b/scripts/publish-insin.sh index 349c09e..d993077 100755 --- a/scripts/publish-insin.sh +++ b/scripts/publish-insin.sh @@ -25,11 +25,17 @@ cp deploy/insin/epson.service "$payload/" chmod +x "$payload/postinst" "$payload/prem" mkdir -p .tools +case "$(uname -m)" in + x86_64) cli_rid=linux-x64 ;; + aarch64|arm64) cli_rid=linux-arm64 ;; + armv7l|armv6l) cli_rid=linux-arm ;; + *) echo "unsupported host arch: $(uname -m)" >&2; exit 1 ;; +esac manifest=$(curl -fsSL "$INSIN_URL/api/v1/downloads/cli") cli_version=$(printf '%s' "$manifest" \ | python3 -c 'import json,sys; print(json.load(sys.stdin)[0]["version"])') cli_filename=$(printf '%s' "$manifest" \ - | python3 -c 'import json,sys; a=next(x for x in json.load(sys.stdin)[0]["artifacts"] if x["rid"]=="linux-arm64"); print(a["filename"])') + | python3 -c "import json,sys; a=next(x for x in json.load(sys.stdin)[0]['artifacts'] if x['rid']=='$cli_rid'); print(a['filename'])") if [ ! -x ".tools/insin/insin" ] || [ "$(cat .tools/insin/.version 2>/dev/null)" != "$cli_version" ]; then echo "Fetching insin CLI $cli_version" curl -fsSL "$INSIN_URL/api/v1/downloads/cli/$cli_version/$cli_filename" -o /tmp/insin.tar.gz