69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
name: Release to GitHub Packages
|
|
description: Release to GitHub Packages
|
|
|
|
inputs:
|
|
arm64_binary:
|
|
description: Directory for linux arm64 binary
|
|
required: true
|
|
amd64_binary:
|
|
description: Directory for linux amd64 binary
|
|
required: true
|
|
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
sparse-checkout: |
|
|
Dockerfile
|
|
server.json
|
|
sparse-checkout-cone-mode: false
|
|
- id: check-latest
|
|
shell: bash
|
|
run: |
|
|
if [[ "${GITHUB_REF}" =~ ^refs/tags/[^/]+$ && ! "${GITHUB_REF}" =~ -(rc|beta|alpha|dev)$ ]]; then
|
|
echo "is_latest=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "is_latest=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
name: binary
|
|
path: ${{ github.workspace }}/dist
|
|
- uses: docker/setup-qemu-action@v4
|
|
- uses: docker/setup-buildx-action@v4
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
- id: meta
|
|
uses: docker/metadata-action@v6
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
flavor: |
|
|
latest=${{ steps.check-latest.outputs.is_latest }}
|
|
labels: |
|
|
io.modelcontextprotocol.server.name=io.github.eat-pray-ai/yutu
|
|
- id: push
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
target: yutu
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
annotations: ${{ steps.meta.outputs.annotations }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64
|
|
provenance: true
|
|
sbom: true
|
|
build-args: |
|
|
arm64_binary=${{ inputs.amd64_binary }}
|
|
amd64_binary=${{ inputs.amd64_binary }}
|
|
- uses: actions/attest@v4
|
|
with:
|
|
subject-name: ghcr.io/${{ github.repository }}
|
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
push-to-registry: true
|