Skip to content

Workflow file for this run

# This GitHub Actions workflow triggers a JitPack build for the cbioportal-frontend repository whenever a new release is created.
# It constructs the JitPack build URL using the release tag and sends a request to initiate the build process.
name: Trigger JitPack Build on New Release
on:
release:
types:
- created
- prereleased
jobs:
trigger_build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Get release tag
id: get_tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Trigger JitPack Build
run: |
TAG=${{ steps.get_tag.outputs.tag }}
JITPACK_BUILD_URL="https://jitpack.io/com/github/cbioportal/cbioportal-frontend/$TAG/build.log"
MAX_RETRIES=10
RETRY_DELAY=30
COUNTER=0
while [ $COUNTER -lt $MAX_RETRIES ]; do
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$JITPACK_BUILD_URL")
if [ "$HTTP_STATUS" -eq 200 ]; then
echo "Build triggered successfully for version ${TAG}."
exit 0
else
echo "Attempt $((COUNTER+1)) failed with status $HTTP_STATUS: Tag not found yet. Retrying in $RETRY_DELAY seconds..."
((COUNTER++))
sleep $RETRY_DELAY
fi
done
echo "Failed to trigger JitPack build after $MAX_RETRIES attempts."
exit 1