diff --git a/.github/actions/github-packages/action.yml b/.github/actions/github-packages/action.yml index adeabcb..937c394 100644 --- a/.github/actions/github-packages/action.yml +++ b/.github/actions/github-packages/action.yml @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4a92407..1f05d5b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,11 @@ on: workflow_dispatch: push: tags: - - "v*" + - 'v*' + - '!*.*.*-rc*' + - '!*.*.*-beta*' + - '!*.*.*-alpha*' + - '!*.*.*-dev*' permissions: read-all diff --git a/Dockerfile b/Dockerfile index 7dd6fe0..4d9131f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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