-
Notifications
You must be signed in to change notification settings - Fork 69
62 lines (57 loc) · 2.32 KB
/
trigger-external-bindings.yml
File metadata and controls
62 lines (57 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Trigger External Bindings Workflow
# Automatically triggers tests in external repositories (like bdk-jvm) when bdk-ffi changes.
# Runs when bdk-ffi code is pushed to master branch to ensure downstream bindings get notified if their tests break.
# Uses repository dispatch API to trigger workflows in dependent repositories.
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'bdk-ffi/**'
permissions: {}
jobs:
trigger:
name: "Trigger all remote test workflows"
runs-on: ubuntu-24.04
steps:
# Trigger trigger-bdk-jvm-test workflow in bdk-jvm repository
- name: "Trigger tests in bdk-jvm repository"
env:
BDK_JVM_ACCESS_TOKEN: ${{ secrets.BDK_JVM_ACCESS_TOKEN }}
run: |
curl --silent --show-error \
--output /tmp/resp.txt \
--write-out "HTTP Status: %{http_code}\n" \
--request POST \
--header "Accept: application/vnd.github+json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $BDK_JVM_ACCESS_TOKEN" \
--data '{"event_type":"trigger-bdk-jvm-test"}' \
https://api.github.com/repos/bitcoindevkit/bdk-jvm/dispatches
echo "Response body:"
if [ -s /tmp/resp.txt ]; then
jq . /tmp/resp.txt || cat /tmp/resp.txt
else
echo "(empty)"
fi
# Trigger trigger-bdk-python-test workflow in bdk-python repository
- name: Trigger tests in bdk-python repository
env:
BDK_PYTHON_ACCESS_TOKEN: ${{ secrets.BDK_PYTHON_ACCESS_TOKEN }}
run: |
curl --silent --show-error \
--output /tmp/resp_bdk-python.txt \
--write-out "HTTP Status: %{http_code}\n" \
--request POST \
--header "Accept: application/vnd.github+json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $BDK_PYTHON_ACCESS_TOKEN" \
--data '{"event_type":"trigger-bdk-python-test"}' \
https://api.github.com/repos/bitcoindevkit/bdk-python/dispatches
echo "Response body:"
if [ -s /tmp/resp_bdk-python.txt ]; then
jq . /tmp/resp_bdk-python.txt || cat /tmp/resp_bdk-python.txt
else
echo "(empty)"
fi