Skip to content

v0.1.0-rc4: replace withSnapshotLock placeholder with pg_advisory_xac… #8

v0.1.0-rc4: replace withSnapshotLock placeholder with pg_advisory_xac…

v0.1.0-rc4: replace withSnapshotLock placeholder with pg_advisory_xac… #8

name: release-katari-runtime
# Build the katari Docker image (linux/amd64 + linux/arm64) and push
# to GHCR on tag push. Same tag convention as release-katari.yml.
#
# Image name is `katari` (not katari-runtime) — matches the user-facing
# product name. See docs/PUBLISHING.md.
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to build (eg. v0.1.0). Required for manual runs."
required: true
permissions:
contents: read
packages: write
jobs:
image:
name: build & push katari image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Resolve version
id: version
shell: bash
run: |
ref="${{ inputs.tag || github.ref_name }}"
echo "tag=$ref" >> "$GITHUB_OUTPUT"
echo "version=${ref#v}" >> "$GITHUB_OUTPUT"
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute image tags
id: tags
shell: bash
run: |
owner="$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
image="ghcr.io/${owner}/katari"
# Only stable tags update :latest. A prerelease tag (anything
# containing '-' per semver) gets only its versioned tag, so
# end users running `:latest` never inherit an rc.
version="${{ steps.version.outputs.version }}"
tag_lines="${image}:${version}"
case "$version" in
*-*) ;; # prerelease, skip :latest
*) tag_lines="${tag_lines}"$'\n'"${image}:latest" ;;
esac
{
echo "image=${image}"
echo "tags<<EOF"
echo "$tag_lines"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
file: typescript/packages/katari-api-server/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}