-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.41 KB
/
Copy pathci.yml
File metadata and controls
47 lines (41 loc) · 1.41 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
name: CI
on:
push:
branches: [ master, main ]
pull_request:
repository_dispatch:
types: [ upstream-updated ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Build and test
run: |
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
./gradlew clean build --refresh-dependencies --info
else
./gradlew build --info
fi
- name: Publish SNAPSHOT
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publish
- name: Notify downstream repos
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
env:
GH_TOKEN: ${{ secrets.BB4_DISPATCH_TOKEN }}
run: |
DOWNSTREAM=(bb4-shortest-paths bb4-ui)
for repo in "${DOWNSTREAM[@]}"; do
echo "Notifying $repo"
gh api "repos/bb4/$repo/dispatches" \
-f event_type=upstream-updated \
-f "client_payload[upstream]=${{ github.event.repository.name }}"
done