Skip to content

implement generic Retryable from config #371

implement generic Retryable from config

implement generic Retryable from config #371

name: Release with Jitpack
on:
pull_request:
branches:
- master
push:
branches:
- master
- refs/tags/*
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build
run: ./gradlew check
- name: Archive test reports
uses: actions/upload-artifact@v2
with:
name: test-reports
path: build/reports/tests/
- name: Release
run: |
echo "Triggering JitPack build"
PACKAGES_URL="https://jitpack.io/com/github/${GITHUB_REPOSITORY}/${GITHUB_REF#refs/tags/}/"
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
if: startsWith(github.ref, 'refs/tags')