-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (44 loc) · 1.43 KB
/
pr-bb-updates.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
name: "Byte Buddy Update"
on:
pull_request:
permissions:
pull-requests: write
contents: write
jobs:
pr-api-change:
name: PR Byte Buddy change
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
- name: Rebuild byte-buddy if version has changed
run: |
if [ 'byte-buddy-tag' = $(git diff --diff-filter=d --name-only origin/master -- 'byte-buddy-tag' agent/libs | xargs) ]
then
echo Byte Buddy tag was updated
tag=$(cat byte-buddy-tag)
rm agent/libs/byte-buddy*
git clone https://github.com/raphw/byte-buddy.git
cp bb.patch byte-buddy
cd byte-buddy
git checkout $tag
git apply bb.patch
mvn clean package -Pextras -Dskiptests -q
echo Build succeeded
mv ./byte-buddy/target/$tag.jar ../agent/libs
mv ./byte-buddy/target/$tag-sources.jar ../agent/libs
cd ..
rm -rf byte-buddy
sed -i "s|libs/byte-buddy-.+jar|libs/$tag.jar|"
echo updated byte buddy and reference
git add agent/libs
git config --global user.name "GitHub Actions"
git config --global user.email "github_actions_bot@kamon.io"
git commit -m "rebuilt byte buddy"
git push
fi