fix: allow publishing collector artifacts manually

This commit is contained in:
jxxghp
2026-07-12 16:37:05 +08:00
parent 8e60e5571b
commit a30a48b8f4
2 changed files with 9 additions and 3 deletions

View File

@@ -2,6 +2,11 @@ name: Site Adapter Collector
on:
workflow_dispatch:
inputs:
release_tag:
description: Existing release tag to receive collector assets; leave empty for artifacts only
required: false
type: string
release:
types:
- published
@@ -105,7 +110,7 @@ jobs:
publish:
name: Upload collectors to release
if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'release' || inputs.release_tag != ''
needs:
- build
runs-on: ubuntu-latest
@@ -123,6 +128,7 @@ jobs:
- name: Upload assets to published release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag }}
run: |
gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null
gh release upload "$RELEASE_TAG" release-assets/* --clobber --repo "$GITHUB_REPOSITORY"

View File

@@ -33,4 +33,4 @@ chmod +x moviepilot-site-collector-linux
## 维护者发布流程
`.github/workflows/site-adapter-collector.yml` 支持手动触发,也会在 Release 发布后自动构建 Windows、macOS 和 Linux 单文件程序。每个平台先执行 `--help` 启动检查,再上传程序及 SHA-256 摘要为 Workflow ArtifactRelease 事件会在三个平台全部成功后,用 GitHub CLI 把同一组文件附加到触发本次任务的 Release。
`.github/workflows/site-adapter-collector.yml` 支持手动触发,也会在 Release 发布后自动构建 Windows、macOS 和 Linux 单文件程序。每个平台先执行 `--help` 启动检查,再上传程序及 SHA-256 摘要为 Workflow ArtifactRelease 事件会在三个平台全部成功后,文件附加到触发本次任务的 Release;手动触发时填写已有的 `release_tag` 也会上传到该 Release留空则只生成 3 天的测试 Artifact