-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4688 from dippindots/improve_release_process
Adding jitpack build script and label check test for pull request
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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 | ||
|
||
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 "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
- 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" | ||
echo "Triggering JitPack build for $TAG" | ||
curl -I $JITPACK_BUILD_URL | ||
- name: Notify success | ||
run: echo "JitPack build triggered successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This GitHub Actions workflow is designed to automatically check pull requests in the cBioPortal repository for valid labels before they can be merged. | ||
# The workflow ensures that pull requests have labels that are defined in the .github/release-drafter.yml file's "categories" section. | ||
# If a pull request lacks a valid label, the workflow will fail, preventing the merge until valid labels are applied. | ||
name: Label Check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
label-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR Labels | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
wget https://github.com/mikefarah/yq/releases/download/v4.34.2/yq_linux_amd64 -O /usr/local/bin/yq | ||
chmod +x /usr/local/bin/yq | ||
- name: Get Labels from release-drafter.yml | ||
id: get_labels | ||
run: | | ||
curl -s "https://raw.githubusercontent.com/cBioPortal/cbioportal-frontend/master/.github/release-drafter.yml" | \ | ||
yq -r '.categories[].labels[]' > labels.txt | ||
- name: Check Labels | ||
id: check_labels | ||
run: | | ||
PR_NUMBER=$(jq -r ".number" $GITHUB_EVENT_PATH) | ||
PR_LABELS=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \ | ||
jq -r '.labels[].name') | ||
mapfile -t AVAILABLE_LABELS < labels.txt | ||
for LABEL in ${PR_LABELS[@]}; do | ||
if [[ "$LABEL" == "skip-changelog" ]]; then | ||
echo "PR contains a valid label: skip-changelog" | ||
exit 0 # Valid label found, exit successfully | ||
fi | ||
for AVAILABLE_LABEL in "${AVAILABLE_LABELS[@]}"; do | ||
if [[ "$AVAILABLE_LABEL" == "$LABEL" ]]; then | ||
echo "PR contains a valid label: $LABEL" | ||
exit 0 # Valid label found, exit successfully | ||
fi | ||
done | ||
done | ||
echo "No valid label found on PR." | ||
echo "Available label options from release-drafter.yml:" | ||
cat labels.txt | ||
exit 1 # No valid label found, exit with an error |