👷 Extract inputs when build images

This commit is contained in:
OpenWaygate committed 2025-10-18 22:53:33 +08:00
1 parent 6e02330a5e
commit dad0de7fc3
3 files changed
+30 -4

No files matched your search

+21 -1
View File
@@ -1,6 +1,21 @@
name: Release to GitHub Packages
description: Release to GitHub Packages
inputs:
arm64_binary:
description: Directory for linux arm64 binary
required: true
default: yutu_linux_arm64_v8.0/yutu-linux-arm64
amd64_binary:
description: Directory for linux amd64 binary
required: true
default: yutu_linux_amd64_v1/yutu-linux-amd64
add_latest:
description: Whether to add the latest tag
required: false
default: auto
runs:
using: composite
steps:
@@ -12,7 +27,7 @@ runs:
- uses: actions/download-artifact@v4
with:
name: binary
path: '${{ github.workspace }}/dist'
path: ${{ github.workspace }}/dist
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
@@ -24,6 +39,8 @@ runs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=${{ inputs.add_latest }}
labels: |
io.modelcontextprotocol.server.name="io.github.eat-pray-ai/yutu"
- id: push
@@ -38,6 +55,9 @@ runs:
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
build-args: |
arm64_binary=${{ inputs.amd64_binary }}
amd64_binary=${{ inputs.amd64_binary }}
- uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ github.repository }}
+5 -1
View File
@@ -3,7 +3,11 @@ on:
workflow_dispatch:
push:
tags:
- "v*"
- 'v*'
- '!*.*.*-rc*'
- '!*.*.*-beta*'
- '!*.*.*-alpha*'
- '!*.*.*-dev*'
permissions: read-all
+4 -2
View File
@@ -3,12 +3,14 @@
FROM alpine:latest AS binary
ARG TARGETARCH
ARG arm64_binary
ARG amd64_binary
COPY dist /app/
RUN if [[ "${TARGETARCH}" == "arm64" ]]; then \
mv /app/yutu_linux_arm64_v8.0/yutu-linux-arm64 /app/yutu; \
mv /app/${arm64_binary} /app/yutu; \
elif [[ "${TARGETARCH}" == "amd64" ]]; then \
mv /app/yutu_linux_amd64_v1/yutu-linux-amd64 /app/yutu; \
mv /app/${amd64_binary} /app/yutu; \
fi && \
chmod +x /app/yutu