ci: publish CLI images for AMD64 and ARM64

This commit is contained in:
vorotamoroz
2026-07-15 12:39:32 +00:00
parent 908acc4a84
commit b475ea64e2
2 changed files with 11 additions and 5 deletions
+9 -3
View File
@@ -57,7 +57,7 @@ jobs:
MAJOR_MINOR=$(echo "${VERSION}" | cut -d. -f1,2) MAJOR_MINOR=$(echo "${VERSION}" | cut -d. -f1,2)
SHORT_SHA=$(git rev-parse --short HEAD) SHORT_SHA=$(git rev-parse --short HEAD)
IMAGE="ghcr.io/${{ github.repository_owner }}/livesync-cli" IMAGE="ghcr.io/${{ github.repository_owner }}/livesync-cli"
# Build tag list based on the event and git ref # Build tag list based on the event and git ref
TAGS="" TAGS=""
if [[ "${{ github.ref }}" == refs/tags/* ]]; then if [[ "${{ github.ref }}" == refs/tags/* ]]; then
@@ -70,7 +70,7 @@ jobs:
# Other branches / manual run fallback # Other branches / manual run fallback
TAGS="${IMAGE}:${VERSION}-dev-sha-${SHORT_SHA}-cli" TAGS="${IMAGE}:${VERSION}-dev-sha-${SHORT_SHA}-cli"
fi fi
# Determine if the image should be pushed # Determine if the image should be pushed
PUSH="true" PUSH="true"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
@@ -78,7 +78,7 @@ jobs:
PUSH="false" PUSH="false"
fi fi
fi fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "push=${PUSH}" >> $GITHUB_OUTPUT echo "push=${PUSH}" >> $GITHUB_OUTPUT
@@ -89,6 +89,11 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
@@ -126,5 +131,6 @@ jobs:
file: src/apps/cli/Dockerfile file: src/apps/cli/Dockerfile
push: ${{ steps.meta.outputs.push }} push: ${{ steps.meta.outputs.push }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
+2 -2
View File
@@ -76,10 +76,10 @@ For example, to test an executable on `PATH`:
LIVESYNC_CLI_COMMAND='livesync-cli' npm run test:e2e:obsidian:cli-to-obsidian-sync LIVESYNC_CLI_COMMAND='livesync-cli' npm run test:e2e:obsidian:cli-to-obsidian-sync
``` ```
On Linux, the published Docker image can run against the local CouchDB fixture by sharing the temporary directory, using host networking, preserving the host user's file ownership, and overriding the image entrypoint so that the runner can supply its explicit database path. The published image is currently built for AMD64; Docker emulation is therefore required on an ARM host. On Linux, a multi-architecture published Docker image can run against the local CouchDB fixture by sharing the temporary directory, using host networking, preserving the host user's file ownership, and overriding the image entrypoint so that the runner can supply its explicit database path. Images published before ARM64 support remain AMD64-only and require configured Docker emulation on an ARM host.
```bash ```bash
LIVESYNC_CLI_COMMAND="docker run --rm --platform linux/amd64 --network host --user $(id -u):$(id -g) --volume /tmp:/tmp --entrypoint node ghcr.io/vrtmrz/livesync-cli:0.25.81-cli /app/dist/index.cjs" \ LIVESYNC_CLI_COMMAND="docker run --rm --network host --user $(id -u):$(id -g) --volume /tmp:/tmp --entrypoint node ghcr.io/vrtmrz/livesync-cli:edge /app/dist/index.cjs" \
npm run test:e2e:obsidian:cli-to-obsidian-sync npm run test:e2e:obsidian:cli-to-obsidian-sync
``` ```