From 9c01c4f9417834cb5c3b3f6647b48468aa9bc590 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Thu, 26 Oct 2023 11:45:16 +0100 Subject: [PATCH] Add release trigger for downstream targets to update --- .github/workflows/downstream_updates.yml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/downstream_updates.yml diff --git a/.github/workflows/downstream_updates.yml b/.github/workflows/downstream_updates.yml new file mode 100644 index 000000000..e140a4f42 --- /dev/null +++ b/.github/workflows/downstream_updates.yml @@ -0,0 +1,31 @@ +name: downstream-updates + +on: + release: + types: [released] + workflow_dispatch: + inputs: + target_version: + description: 'Version of the submodule to update downstream repos to' + required: true + type: string + +jobs: + update-dependencies: + runs-on: ubuntu-latest + env: + RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.target_version || github.event.release.tag_name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + matrix: + downstream_repo: ['bugsnag/bugsnag-unity'] + steps: + - name: Install libcurl4-openssl-dev and net-tools + run: | + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev net-tools + + - run: > + curl -X POST https://api.github.com/repos/${{ matrix.downstream_repo }}/dispatches + -H 'Content-Type: application/json' + -H "Authorization: Bearer $GITHUB_TOKEN" + -d '{"event_type":"update-dependency","client_payload": {"target_submodule":"bugsnag-cocoa", "target_version": "$RELEASE_VERSION"}}'