-
Notifications
You must be signed in to change notification settings - Fork 163
48 lines (40 loc) · 1.33 KB
/
warn-version-bump.yml
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
name: Warn Version Bump
on: pull_request
jobs:
warn-version-bump:
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
uses: actions/[email protected]
with:
ref: ${{ github.base_ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Generate the api file
run: |
./gradlew exportApi --no-daemon
- name: Save public.api from target branch
run: |
mkdir ~/common/ && \
mkdir ~/generativeai/ && \
mv generativeai/public.api ~/generativeai/public.api && \
mv common/public.api ~/common/public.api
- name: Checkout branch
uses: actions/[email protected]
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Copy saved api to branch
run: |
mv ~/generativeai/public.api generativeai/public.api && \
mv ~/common/public.api common/public.api
- name: Run API versioning check
run: |
if ! test -d .changes || git diff --quiet ${{ github.event.pull_request.base.sha }}..HEAD .changes ; then ./gradlew warnVersionBump ; else exit 0 ; fi