generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (34 loc) · 1.05 KB
/
jitpack_build.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
name: Trigger JitPack Build
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger Build in JitPack
run: |
echo "Triggering JitPack build"
PACKAGES_URL="https://jitpack.io/com/github/${GITHUB_REPOSITORY}/${GITHUB_REF#refs/tags/}/"
echo "Curling from: ${PACKAGES_URL}"
PACKAGES_FILE="packages.txt"
touch ${PACKAGES_FILE}
# Try the URL 6 times before failing
count=1
until [[ $count -gt 6 ]] || grep -q build.log ${PACKAGES_FILE} ; do
echo "Attempt ${count}/6"
STATUS=$(curl -s -o packages.txt -w "%{http_code}" --max-time 900 ${PACKAGES_URL})
let count+=1
if [[ "${STATUS}" -gt 399 ]]; then
sleep 30
fi
done
echo "::group::Files Available"
echo $(cat ${PACKAGES_FILE})
echo "::endgroup::"
if [[ ${STATUS} -gt 399 ]] ; then
echo "FAILURE: ${STATUS} response from JitPack"
exit 1
fi