From cefd217cf2ac405f39daae4c8354686d89d3e03f Mon Sep 17 00:00:00 2001 From: yxf Date: Wed, 23 Sep 2026 16:56:36 +0800 Subject: [PATCH] ci: announce runner.py.json changes to gpustack-ota Dispatch source-changed to gpustack/gpustack-ota when a merge to main touches gpustack_runner/runner.py.json, so https://ota.gpustack.ai/pre follows main. The token comes from the prt-generator app and is limited to Contents: write on gpustack-ota; the workflow can also be run by hand to check or resend the announcement. --- .github/workflows/ota-pre.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ota-pre.yml diff --git a/.github/workflows/ota-pre.yml b/.github/workflows/ota-pre.yml new file mode 100644 index 00000000..fdb895b7 --- /dev/null +++ b/.github/workflows/ota-pre.yml @@ -0,0 +1,40 @@ +name: OTA Pre + +# Tells gpustack/gpustack-ota that runner.py.json changed on main, so +# https://ota.gpustack.ai/pre follows main within minutes of the merge. The path +# is the one gpustack-ota's sources.yaml reads from here. Run it by hand to check +# the announcement reaches gpustack-ota, or to resend one that did not. + +on: + push: + branches: + - main + paths: + - 'gpustack_runner/runner.py.json' + workflow_dispatch: {} + +permissions: + contents: read + +jobs: + announce: + runs-on: ubuntu-latest + timeout-minutes: 5 + # A fork's main is nothing the OTA server publishes. + if: github.repository == 'gpustack/runner' + steps: + - name: Generate dispatch token + id: token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.CI_PRT_GENERATOR_ID }} + private-key: ${{ secrets.CI_PRT_GENERATOR_KEY }} + owner: gpustack + repositories: gpustack-ota + # All a dispatch needs; unset, it inherits every installation permission. + permission-contents: write + + - name: Announce the change + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + run: gh api repos/gpustack/gpustack-ota/dispatches -f event_type=source-changed