Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automate jitpack build and frontend version update for new releases #5067

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion .github/workflows/jitpack-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,55 @@ jobs:
done

echo "Failed to trigger JitPack build after $MAX_RETRIES attempts."
exit 1
exit 1

- name: Get POM File
run: |
TAG=${{ steps.get_tag.outputs.tag }}
JITPACK_POM_URL="https://jitpack.io/com/github/cbioportal/cbioportal-frontend/$TAG/cbioportal-frontend-$TAG.pom"

MAX_RETRIES=60
RETRY_DELAY=30
COUNTER=0

while [ $COUNTER -lt $MAX_RETRIES ]; do
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$JITPACK_POM_URL")

if [ "$HTTP_STATUS" -eq 200 ]; then
echo "POM file successfully found."
exit 0
else
echo "Attempt $((COUNTER+1)) failed with status $HTTP_STATUS: POM file not found yet. Retrying in $RETRY_DELAY seconds..."
COUNTER=$((COUNTER+1))
sleep $RETRY_DELAY
fi
done

echo "Failed to find POM file after $MAX_RETRIES attempts."
exit 1

- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.BACKEND_REPO_TOKEN }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts

- name: Set up git
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'

- name: Checkout cbioportal/cbioportal
run: |
git clone git@github.com:cBioPortal/cbioportal.git

- name: Update backend to use latest frontend commit
run: |
TAG=${{ steps.get_tag.outputs.tag }}
cd cbioportal
sed -i "s|<version>\(.*\)-SNAPSHOT</version>|<version>\1</version>|" pom.xml
sed -i "s|<frontend.version>.*</frontend.version>|<frontend.version>$TAG</frontend.version>|" pom.xml
git add pom.xml
git commit -m "Frontend $TAG"
git push
Loading