select insin CLI by host arch, drop qemu note, bump version to 1.0.15
This commit is contained in:
@@ -317,9 +317,9 @@ Insin uses a flat global package namespace with the `AdminToken` auth header (NO
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
: "${INSIN_URL:?}" "${INSIN_TOKEN:?}"
|
: "${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" \
|
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#* }
|
VERSION=${LATEST% *}; FILENAME=${LATEST#* }
|
||||||
curl -fsSL "$INSIN_URL/api/v1/downloads/cli/$VERSION/$FILENAME" -o /tmp/insin.tar.gz
|
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
|
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.
|
- **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.
|
- **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`).
|
- **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.
|
- **`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).
|
- 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`.
|
- **List packages:** `curl -H "Authorization: AdminToken $INSIN_TOKEN" $INSIN_URL/api/v1/admin/packages`.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>1.0.14</Version>
|
<Version>1.0.15</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -25,11 +25,17 @@ cp deploy/insin/epson.service "$payload/"
|
|||||||
chmod +x "$payload/postinst" "$payload/prem"
|
chmod +x "$payload/postinst" "$payload/prem"
|
||||||
|
|
||||||
mkdir -p .tools
|
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")
|
manifest=$(curl -fsSL "$INSIN_URL/api/v1/downloads/cli")
|
||||||
cli_version=$(printf '%s' "$manifest" \
|
cli_version=$(printf '%s' "$manifest" \
|
||||||
| python3 -c 'import json,sys; print(json.load(sys.stdin)[0]["version"])')
|
| python3 -c 'import json,sys; print(json.load(sys.stdin)[0]["version"])')
|
||||||
cli_filename=$(printf '%s' "$manifest" \
|
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
|
if [ ! -x ".tools/insin/insin" ] || [ "$(cat .tools/insin/.version 2>/dev/null)" != "$cli_version" ]; then
|
||||||
echo "Fetching insin CLI $cli_version"
|
echo "Fetching insin CLI $cli_version"
|
||||||
curl -fsSL "$INSIN_URL/api/v1/downloads/cli/$cli_version/$cli_filename" -o /tmp/insin.tar.gz
|
curl -fsSL "$INSIN_URL/api/v1/downloads/cli/$cli_version/$cli_filename" -o /tmp/insin.tar.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user