-
-
Notifications
You must be signed in to change notification settings - Fork 111
82 lines (70 loc) · 2.5 KB
/
blackfire.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Blackfire
on:
schedule:
- cron: "45 5 * * *"
jobs:
watch:
name: Watch for new version
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
- name: Fetch last version
id: fetch_version
run: |
cd layers/blackfire;
for VERSION in 80 81 82; do
BF_AGENT_VERSION=$(curl -s -o probe -D - https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$VERSION | grep -i 'X-Blackfire-Release-Version: ' | sed "s%X-Blackfire-Release-Version: %%I" | sed s%.$%%);
php ./store.php $VERSION $BF_AGENT_VERSION;
done
rm probe
echo ::set-output name=last::$BF_AGENT_VERSION
cat versions.json
- name: Check if anything changed
run: |
if [[ $(git diff --numstat | wc -l) -eq 0 ]]; then
echo "No significant changes."
exit 1
fi
- name: Download dependencies
run: |
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
- name: Build layers
run: |
make clean
make layers layer=blackfire
- name: Write change log
run: |
LATEST_TAG=$(git describe --abbrev=0 --tags)
ARR=(${LATEST_TAG//./ })
ARR[2]=$((${ARR[2]}+1))
NEW_TAG="${ARR[0]}.${ARR[1]}.${ARR[2]}"
sed -i -re "s/^## $LATEST_TAG/## $NEW_TAG\n\n- Updated Blackfire to version ${{ steps.fetch_version.outputs.last }}.\n\n## $LATEST_TAG/" CHANGELOG.md
- name: Publish
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
run: |
php ./bref-extra publish
sleep 20
php ./bref-extra list
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
branch: blackfire-update
author: Bref Bot <[email protected]>
committer: Bref Bot <[email protected]>
commit-message: Update Blackfire extension
title: Update Blackfire extension
body: |
The Blackfire extension was updated to ${{ steps.fetch_version.outputs.last }}.
Ping @nyholm, please release this.