refactor(ci): trigger Homebrew/Scoop publish on release event

Move packages job from release.yml to publish-packages.yml, triggered
by release published/released events. Keeps workflow_dispatch as a
manual fallback. Now all external publishing (Homebrew, Scoop, 1Panel,
QQ notify) triggers at the same time: when a prerelease is promoted
to a full release.
This commit is contained in:
t8y2 committed 2026-05-10 22:23:25 +08:00
1 parent 302835bebb
commit 417b74cc51
3 files changed
+46 -208

No files matched your search

+4 -1
View File
@@ -1,6 +1,8 @@
name: Publish Packages
on:
release:
types: [published, released]
workflow_dispatch:
inputs:
tag:
@@ -19,11 +21,12 @@ jobs:
publish:
name: Publish to Homebrew & Scoop
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || (!github.event.release.draft && !github.event.release.prerelease) }}
steps:
- name: Extract version from tag
id: version
run: |
TAG="${{ github.event.inputs.tag }}"
TAG="${{ github.event.release.tag_name || github.event.inputs.tag }}"
TAG="$(echo "${TAG}" | xargs)"
VERSION="${TAG#v}"
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then