Check linkedin/cruise-control new release #271
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
name: Check linkedin/cruise-control new release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
check-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Get current tag | |
id: current_release | |
run: | | |
# cc_release | |
cc_current_release=$(grep "ARG CC_TAG" Dockerfile | cut -d '=' -f 2) | |
echo "cc_current_release=$cc_current_release" >> $GITHUB_OUTPUT | |
# cc_ui_release | |
cc_ui_current_release=$(grep "ARG CC_TAG_UI" Dockerfile | cut -d '=' -f 2) | |
echo "cc_ui_current_release=$cc_ui_current_release" >> $GITHUB_OUTPUT | |
# iam_release | |
iam_current_release=$(grep "ARG AWS_MSK_IAM_AUTH_VERSION" Dockerfile | cut -d '=' -f 2) | |
echo "iam_current_release=$iam_current_release" >> $GITHUB_OUTPUT | |
- name: Install updatecli | |
uses: updatecli/updatecli-action@v2 | |
- name: Update dependencies | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} | |
run: | | |
updatecli apply --config .github/updatecli/dependencies.yaml --commit=false | |
- name: Get latest tag | |
id: latest_release | |
run: | | |
# cc_release | |
cc_latest_release=$(grep "ARG CC_TAG" Dockerfile | cut -d '=' -f 2) | |
echo "cc_latest_release=$cc_latest_release" >> $GITHUB_OUTPUT | |
# cc_ui_release | |
cc_ui_latest_release=$(grep "ARG CC_TAG_UI" Dockerfile | cut -d '=' -f 2) | |
echo "cc_ui_latest_release=$cc_ui_latest_release" >> $GITHUB_OUTPUT | |
# iam_release | |
iam_latest_release=$(grep "ARG AWS_MSK_IAM_AUTH_VERSION" Dockerfile | cut -d '=' -f 2) | |
echo "iam_latest_release=$iam_latest_release" >> $GITHUB_OUTPUT | |
# complete_tag | |
echo "complete_release=cc$cc_latest_release-iam$iam_latest_release" >> $GITHUB_OUTPUT | |
- name: Check if exists changes | |
id: check_changes | |
env: | |
cc_current_release: ${{ steps.current_release.outputs.cc_current_release }} | |
cc_latest_release: ${{ steps.latest_release.outputs.cc_latest_release }} | |
cc_ui_current_release: ${{ steps.current_release.outputs.cc_ui_current_release }} | |
cc_ui_latest_release: ${{ steps.latest_release.outputs.cc_ui_latest_release }} | |
iam_current_release: ${{ steps.current_release.outputs.iam_current_release }} | |
iam_latest_release: ${{ steps.latest_release.outputs.iam_latest_release }} | |
run: | | |
# Cruise Control | |
if [ "$cc_current_release" != "$cc_latest_release" ]; then | |
body+="Cruise Control version:\n" | |
body+=" - :information_source: Current: \`$cc_current_release\`\n" | |
body+=" - :up: Upgrade: \`$cc_latest_release\`\n" | |
body+=" - Changelog: https://github.com/linkedin/cruise-control/releases/tag/$cc_latest_release\n\n" | |
echo "release_changed=true" >> $GITHUB_OUTPUT | |
fi | |
# Cruise Control UI | |
if [ "$cc_ui_current_release" != "$cc_ui_latest_release" ]; then | |
body+="Cruise Control UI version:\n" | |
body+=" - :information_source: Current: \`$cc_ui_current_release\`\n" | |
body+=" - :up: Upgrade: \`$cc_ui_latest_release\`\n" | |
body+=" - Changelog: https://github.com/linkedin/cruise-control-ui/releases/tag/v$cc_ui_latest_release\n\n" | |
echo "release_changed=true" >> $GITHUB_OUTPUT | |
fi | |
# IAM | |
if [ "$iam_current_release" != "$iam_latest_release" ]; then | |
body+="AWS IAM Auth version:\n" | |
body+=" - :information_source: Current: \`$iam_current_release\`\n" | |
body+=" - :up: Upgrade: \`$iam_latest_release\`\n" | |
body+=" - Changelog: https://github.com/aws/aws-msk-iam-auth/releases/tag/v$iam_latest_release\n\n" | |
echo "release_changed=true" >> $GITHUB_OUTPUT | |
fi | |
echo -e "$body" > pr-output.log | |
- name: Create PR changes | |
if: steps.check_changes.outputs.release_changed == 'true' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.PAT_GITHUB }} | |
commit-message: "feat: new cruise-control version ${{ steps.latest_release.outputs.complete_release }}" | |
signoff: false | |
branch: feat/upgrade-cruise-control-${{ steps.latest_release.outputs.complete_release }} | |
delete-branch: true | |
title: '[cruise-control] new release: ${{ steps.latest_release.outputs.complete_release }}' | |
body-path: pr-output.log | |
labels: | | |
auto-pr-bump-version |