From 619ea31ea4756b832dab493b69dff1944d5c7a60 Mon Sep 17 00:00:00 2001 From: yhmo Date: Fri, 5 Jun 2026 17:58:15 +0800 Subject: [PATCH] Add notify-conanfiles workflow Signed-off-by: yhmo --- .github/workflows/notify-conanfiles.yaml | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/notify-conanfiles.yaml diff --git a/.github/workflows/notify-conanfiles.yaml b/.github/workflows/notify-conanfiles.yaml new file mode 100644 index 0000000..a36d24d --- /dev/null +++ b/.github/workflows/notify-conanfiles.yaml @@ -0,0 +1,55 @@ +name: Notify conanfiles + +run-name: notify conanfiles for ${{ github.ref_name }} + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: read + +jobs: + # When a new release tag is pushed to milvus-common, send a repository_dispatch event + # to the conanfiles repo to trigger the release of the corresponding Conan package. + dispatch: + name: send milvus-common release dispatch + if: github.repository == 'zilliztech/milvus-common' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Send repository_dispatch to conanfiles + env: + GH_TOKEN: ${{ secrets.CONANFILES_DISPATCH_TOKEN }} + TAG: ${{ github.ref_name }} + SOURCE_REPO: zilliztech/milvus-common + run: | + set -euo pipefail + + if [ -z "$GH_TOKEN" ]; then + echo "CONANFILES_DISPATCH_TOKEN is not configured" >&2 + exit 1 + fi + + if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$ ]]; then + echo "Unsupported tag format: $TAG" >&2 + exit 1 + fi + + COMMIT=$(git rev-list -n 1 "$TAG") + if [ -z "$COMMIT" ]; then + echo "Unable to resolve commit for tag: $TAG" >&2 + exit 1 + fi + + gh api repos/milvus-io/conanfiles/dispatches \ + --method POST \ + --field event_type=recipe-release \ + --field "client_payload[tag]=${TAG}" \ + --field "client_payload[commit]=${COMMIT}" \ + --field "client_payload[source_repo]=${SOURCE_REPO}"