Skip to content

Update Jesse version #8078

Update Jesse version

Update Jesse version #8078

Workflow file for this run

name: Update Jesse version
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
packages: write
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
latest_version: ${{ steps.get_latest_version.outputs.latest_version }}
steps:
- name: Get latest Jesse pip version
id: get_latest_version
run: |
LATEST_VERSION=$(curl -s https://pypi.org/pypi/jesse/json | jq -r '.info.version')
echo "Latest Jesse version: $LATEST_VERSION"
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
update-chart:
runs-on: ubuntu-latest
needs: get-version
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install YQ
uses: dcarbone/[email protected]
- name: Read current appVersion from Chart.yaml
id: read_current_version
run: |
CURRENT_VERSION=$(yq '.appVersion' Chart.yaml)
echo "Current Jesse version: $CURRENT_VERSION"
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
- name: Compare versions and update Chart.yaml if needed
id: update_chart
run: |
latest_version="${{ needs.get-version.outputs.latest_version }}"
current_version="${{ steps.read_current_version.outputs.current_version }}"
if [ "$(printf '%s\n' "$latest_version" "$current_version" | sort -V | tail -n1)" != "$current_version" ]; then
echo "New version detected: Updating Chart.yaml..."
yq eval -i ".appVersion = \"$latest_version\"" Chart.yaml
# Increment patch version (e.g., 0.0.11 -> 0.0.12)
CHART_VERSION=$(yq '.version' Chart.yaml)
NEW_CHART_VERSION=$(echo $CHART_VERSION | awk -F. '{print $1"."$2"."$3+1}')
yq eval -i ".version = \"$NEW_CHART_VERSION\"" Chart.yaml
echo "Updated Chart version to $NEW_CHART_VERSION"
else
echo "No new version found. Skipping update."
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "Update Jesse to version ${{ needs.get-version.outputs.latest_version }}"
branch: update-jesse-${{ needs.get-version.outputs.latest_version }}
delete-branch: true
title: "Update Jesse to ${{ needs.get-version.outputs.latest_version }}"
body: "Update Jesse Helm Chart appVersion to `${{ needs.get-version.outputs.latest_version }}` and bump patch version."
labels: automated
build-arm64-image:
needs: get-version
uses: TrianaLab/jesse-chart/.github/workflows/image-build.yaml@main
with:
version: ${{ needs.get-version.outputs.latest_version }}