Bump OpenClaw Version #340
This file contains hidden or 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: Bump OpenClaw Version | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Every hour | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'OpenClaw version (e.g., 2026.3.2). Leave empty to fetch latest.' | |
| required: false | |
| type: string | |
| chart_bump: | |
| description: 'Chart version bump type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| default: patch | |
| dry_run: | |
| description: 'Dry run (show changes without committing)' | |
| required: false | |
| type: boolean | |
| default: false | |
| force: | |
| description: 'Force release even if version unchanged (for re-releasing)' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Generate App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| - name: Get latest OpenClaw version | |
| id: get-version | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if [ -n "${{ inputs.version }}" ]; then | |
| version="${{ inputs.version }}" | |
| else | |
| version=$(gh api repos/openclaw/openclaw/releases/latest --jq '.tag_name' | sed 's/^v//') | |
| fi | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "OpenClaw version: $version" | |
| - name: Get current versions | |
| id: current | |
| run: | | |
| chart_version=$(grep '^version:' charts/openclaw-helm/Chart.yaml | awk '{print $2}') | |
| app_version=$(grep '^appVersion:' charts/openclaw-helm/Chart.yaml | awk '{print $2}' | tr -d '"') | |
| echo "chart_version=$chart_version" >> "$GITHUB_OUTPUT" | |
| echo "app_version=$app_version" >> "$GITHUB_OUTPUT" | |
| echo "Current chart: $chart_version, app: $app_version" | |
| - name: Check if update needed | |
| id: check | |
| run: | | |
| if [ "${{ inputs.force }}" = "true" ]; then | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| echo "Force mode enabled" | |
| elif [ "${{ steps.get-version.outputs.version }}" != "${{ steps.current.outputs.app_version }}" ]; then | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| echo "OpenClaw version changed" | |
| else | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| echo "Already on latest version" | |
| fi | |
| - name: Calculate new chart version | |
| if: steps.check.outputs.skip != 'true' | |
| id: new-version | |
| run: | | |
| if [ "${{ inputs.force }}" = "true" ]; then | |
| echo "new_version=${{ steps.current.outputs.chart_version }}" >> "$GITHUB_OUTPUT" | |
| echo "Force mode: reusing existing chart version ${{ steps.current.outputs.chart_version }}" | |
| else | |
| current="${{ steps.current.outputs.chart_version }}" | |
| IFS='.' read -r major minor patch <<< "$current" | |
| bump_type="${{ inputs.chart_bump }}" | |
| bump_type="${bump_type:-patch}" | |
| case "$bump_type" in | |
| major) major=$((major + 1)); minor=0; patch=0 ;; | |
| minor) minor=$((minor + 1)); patch=0 ;; | |
| patch) patch=$((patch + 1)) ;; | |
| esac | |
| new_version="${major}.${minor}.${patch}" | |
| echo "new_version=$new_version" >> "$GITHUB_OUTPUT" | |
| echo "New chart version: $new_version" | |
| fi | |
| - name: Update Chart.yaml | |
| if: steps.check.outputs.skip != 'true' | |
| run: | | |
| sed -i "s/^version: .*/version: ${{ steps.new-version.outputs.new_version }}/" charts/openclaw-helm/Chart.yaml | |
| sed -i "s/^appVersion: .*/appVersion: \"${{ steps.get-version.outputs.version }}\"/" charts/openclaw-helm/Chart.yaml | |
| - name: Update values.yaml | |
| if: steps.check.outputs.skip != 'true' | |
| run: | | |
| old_version="${{ steps.current.outputs.app_version }}" | |
| new_version="${{ steps.get-version.outputs.version }}" | |
| sed -i "s/tag: \"${old_version}\"/tag: \"${new_version}\"/" charts/openclaw-helm/values.yaml | |
| - name: Show changes | |
| if: steps.check.outputs.skip != 'true' | |
| run: git diff | |
| - name: Commit, tag and push | |
| if: steps.check.outputs.skip != 'true' && inputs.dry_run != true && inputs.force != true | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| git config user.name "thepagent" | |
| git config user.email "thepagent@users.noreply.github.com" | |
| git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }} | |
| git add charts/openclaw-helm/Chart.yaml charts/openclaw-helm/values.yaml | |
| git commit -m "chore: bump OpenClaw to ${{ steps.get-version.outputs.version }}" | |
| git push | |
| - name: Trigger release workflow | |
| if: steps.check.outputs.skip != 'true' && inputs.dry_run != true && inputs.force != true | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| gh workflow run release.yml --repo ${{ github.repository }} | |
| # Packaging, OCI push, GitHub Release, and gh-pages index are all handled by release.yml | |
| - name: Dry run summary | |
| if: steps.check.outputs.skip != 'true' && inputs.dry_run == true | |
| run: | | |
| echo "::notice::Dry run - no changes committed" | |
| echo "Would bump OpenClaw to ${{ steps.get-version.outputs.version }}" | |
| echo "Would bump chart to ${{ steps.new-version.outputs.new_version }}" |