Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 43 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@ jobs:
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check_version.outputs.version_changed }}
new_version: ${{ steps.check_version.outputs.new_version }}
current_version: ${{ steps.get_version.outputs.current_version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Get current version
id: get_version
run: |
CURRENT_VERSION=$(grep "version = " pyproject.toml | cut -d'"' -f2)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT

- name: Check if version changed
id: check_version
run: |
git diff HEAD^ HEAD -- pyproject.toml | grep -q "version = " || exit 0
NEW_VERSION=$(grep "version = " pyproject.toml | cut -d'"' -f2)
echo "version_changed=true" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
if git diff HEAD^ HEAD -- pyproject.toml | grep -q "version = "; then
echo "version_changed=true" >> $GITHUB_OUTPUT
else
echo "version_changed=false" >> $GITHUB_OUTPUT
fi

build-and-publish-pypi:
needs: check-version
Expand Down Expand Up @@ -56,9 +63,7 @@ jobs:
verbose: true
print-hash: true

build-and-publish-docker:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
build-and-publish-docker-latest:
runs-on: ubuntu-latest

steps:
Expand All @@ -76,22 +81,42 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
- name: Build and push latest Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: getmeili/meilisearch-mcp:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-and-publish-docker-versioned:
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
images: getmeili/meilisearch-mcp
tags: |
type=raw,value=${{ needs.check-version.outputs.new_version }}
type=raw,value=latest
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
- name: Build and push versioned Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: getmeili/meilisearch-mcp:${{ needs.check-version.outputs.current_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ uv pip install -e .

Perfect for containerized environments like n8n workflows!

#### From Docker Hub (Recommended)
#### From Docker Hub

```bash
# Pull the latest image
Expand Down