Bump QuestDB Version #3
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 QuestDB Version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| appVersion: | |
| description: 'QuestDB version (e.g. 9.3.4)' | |
| required: true | |
| type: string | |
| chartVersion: | |
| description: 'Chart version (leave empty to auto-increment patch)' | |
| required: false | |
| type: string | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install yq | |
| run: | | |
| YQ_VERSION=v4.44.3 | |
| wget -q "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -O /usr/local/bin/yq | |
| chmod +x /usr/local/bin/yq | |
| - name: Determine chart version | |
| id: version | |
| run: | | |
| APP_VERSION="${{ inputs.appVersion }}" | |
| CHART_VERSION="${{ inputs.chartVersion }}" | |
| if [ -z "$CHART_VERSION" ]; then | |
| CURRENT=$(yq '.version' charts/questdb/Chart.yaml) | |
| MAJOR=$(echo "$CURRENT" | cut -d. -f1) | |
| MINOR=$(echo "$CURRENT" | cut -d. -f2) | |
| PATCH=$(echo "$CURRENT" | cut -d. -f3) | |
| CHART_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))" | |
| fi | |
| echo "app_version=$APP_VERSION" >> "$GITHUB_OUTPUT" | |
| echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Update Chart.yaml and values.yaml | |
| run: | | |
| yq -i '.version = "${{ steps.version.outputs.chart_version }}"' charts/questdb/Chart.yaml | |
| yq -i '.appVersion = "${{ steps.version.outputs.app_version }}"' charts/questdb/Chart.yaml | |
| yq -i '.image.tag = "${{ steps.version.outputs.app_version }}"' charts/questdb/values.yaml | |
| - name: Create pull request | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| BRANCH="chart-update/${{ steps.version.outputs.chart_version }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$BRANCH" | |
| git add charts/questdb/Chart.yaml charts/questdb/values.yaml | |
| git commit -m "Bump chart to ${{ steps.version.outputs.chart_version }} (QuestDB ${{ steps.version.outputs.app_version }})" | |
| git push origin "$BRANCH" | |
| gh pr create \ | |
| --title "Bump chart to ${{ steps.version.outputs.chart_version }} (QuestDB ${{ steps.version.outputs.app_version }})" \ | |
| --body "## Summary | |
| - Chart version: \`${{ steps.version.outputs.chart_version }}\` | |
| - QuestDB version: \`${{ steps.version.outputs.app_version }}\` | |
| Merging will trigger a release to OCI registry and GitHub Pages." |