VectorChord #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: VectorChord | |
on: | |
workflow_dispatch: | |
jobs: | |
versions: | |
runs-on: ubuntu-latest | |
outputs: | |
VECTORCHORD: ${{ steps.versions.outputs.VECTORCHORD }} | |
PGVECTOR: ${{ steps.versions.outputs.PGVECTOR }} | |
steps: | |
- name: Get latest versions | |
id: versions | |
run: | | |
VECTORCHORD=$(curl -s https://api.github.com/repos/tensorchord/VectorChord/releases/latest | jq -r '.tag_name' | sed 's/^v//') | |
echo "VECTORCHORD=${VECTORCHORD}" >> $GITHUB_OUTPUT | |
PGVECTOR=$(curl -s https://api.github.com/repos/pgvector/pgvector/tags | jq -r '.[0].name' | sed 's/^v//') | |
echo "PGVECTOR=${PGVECTOR}" >> $GITHUB_OUTPUT | |
docker: | |
needs: ["versions"] | |
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm64' }} | |
strategy: | |
matrix: | |
pg_major: ["14", "15", "16", "17"] | |
platform: ["amd64", "arm64"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push PostgreSQL release to Docker Registry | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./vchord | |
push: true | |
platforms: linux/${{ matrix.platform }} | |
provenance: false | |
tags: | | |
tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-${{ matrix.platform }} | |
ghcr.io/tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-${{ matrix.platform }} | |
build-args: | | |
BASE=${{ matrix.pg_major }}-bookworm | |
VCHORD=${{ needs.versions.outputs.VECTORCHORD }} | |
PGVECTOR=${{ needs.versions.outputs.PGVECTOR }} | |
create-manifests: | |
needs: ["docker"] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pg_major: ["14", "15", "16", "17"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create manifest and push | |
run: | | |
docker manifest create \ | |
tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }} \ | |
--amend tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-amd64 \ | |
--amend tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-arm64 | |
docker manifest push tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }} | |
docker manifest create \ | |
ghcr.io/tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }} \ | |
--amend ghcr.io/tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-amd64 \ | |
--amend ghcr.io/tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }}-arm64 | |
docker manifest push ghcr.io/tensorchord/vchord-postgres:pg${{ matrix.pg_major }}-v${{ needs.versions.outputs.VECTORCHORD }} |