Skip to content

fix: Set catalog mode to readwritecreate in spidapter (#9519) #10

fix: Set catalog mode to readwritecreate in spidapter (#9519)

fix: Set catalog mode to readwritecreate in spidapter (#9519) #10

name: Build spidapter binary and Docker Image
on:
push:
branches:
- trunk
paths:
- 'tools/spidapter/**'
- 'crates/test-framework/**'
- 'Cargo.lock'
- '.github/workflows/spidapter_build_and_release.yml'
- '.github/actions/build-spidapter/**'
workflow_dispatch:
inputs:
publish:
description: 'Publish Docker image to GHCR'
required: false
type: boolean
default: false
permissions:
contents: read
packages: write
jobs:
build-binary:
name: Build spidapter
runs-on: spiceai-dev-runners
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Install MinIO
uses: ./.github/actions/setup-minio
with:
minio_endpoint: ${{ secrets.TEST_MINIO_ENDPOINT }}
minio_access_key: ${{ secrets.TEST_MINIO_ACCESS_KEY }}
minio_secret_key: ${{ secrets.TEST_MINIO_SECRET_KEY }}
- name: Build spidapter
uses: ./.github/actions/build-spidapter
with:
install_to_system_path: 'false'
upload_artifact: 'true'
force_rebuild: 'true'
download_from_minio: 'true'
minio_endpoint: ${{ secrets.TEST_MINIO_ENDPOINT }}
minio_access_key: ${{ secrets.TEST_MINIO_ACCESS_KEY }}
minio_secret_key: ${{ secrets.TEST_MINIO_SECRET_KEY }}
- name: Print version
run: ./target/release/spidapter --version
build-docker:
name: Build Docker image
needs: build-binary
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Download binary
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v6
with:
name: spidapter-linux
path: ./build
- name: List artifacts
run: ls -lR ./build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Login to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Copy Dockerfile to build context
run: cp tools/spidapter/Dockerfile ./build/Dockerfile
- name: Build image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: ./build
file: ./build/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') }}
tags: |
ghcr.io/${{ github.repository_owner }}/spidapter:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/spidapter:latest
cache-from: type=gha,scope=spidapter
cache-to: type=gha,scope=spidapter,mode=max